Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
protocol: add river_window_manager_v1.exit_session
protocol/river-window-management-v1.xml | 12 ++++++++++++
river/WindowManager.zig | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/protocol/river-window-management-v1.xml b/protocol/river-window-management-v1.xml
index 34536dc..dd9e556 100644
--- a/protocol/river-window-management-v1.xml
+++ b/protocol/river-window-management-v1.xml
@@ -305,6 +305,18 @@
<arg name="surface" type="object" interface="wl_surface"
summary="base surface"/>
</request>
+
+ <request name="exit_session" since="4">
+ <description summary="exit the Wayland session">
+ End the current Wayland session and exit the compositor.
+ All Wayland clients running in the current session, including
+ the window manager, will be disconnected.
+
+ Window managers should only make this request if the user explicitly
+ asks to exit the Wayland session, not for example on normal window
+ manager termination.
+ </description>
+ </request>
</interface>
<interface name="river_window_v1" version="4">
diff --git a/river/WindowManager.zig b/river/WindowManager.zig
index 4c3a340..011cd2a 100644
--- a/river/WindowManager.zig
+++ b/river/WindowManager.zig
@@ -187,6 +187,10 @@ fn handleRequest(
return;
};
},
+ .exit_session => {
+ log.info("window manager requested to exit session", .{});
+ server.wl_server.terminate();
+ },
}
}