git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commita2c118be843e54294a6794d6dae8965dfac0a64d
parentb5e32cc798
authorIsaac Freund <[email protected]>
date2026-03-05 10:56
river: remove hardcoded Ctrl+Alt+Delete keybinding

A hardcoded keybinding that exits the Wayland session without a
confirmation prompt is poor UX, rely on the window manager to make
the exit_session request for now.

In the future I plan to add some kind of session-management menu to
river accessed through a hardcoded keybinding that allows the user
to switch between/restart window managers or exit river with a
confirmation prompt.

 doc/river.1.scd         |  5 +----
 river/KeyboardGroup.zig | 13 ++-----------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/doc/river.1.scd b/doc/river.1.scd
index 2fd1a9b..61641c2 100644
--- a/doc/river.1.scd
+++ b/doc/river.1.scd
@@ -40,15 +40,12 @@ https://codeberg.org/river/wiki/src/branch/main/pages/wm-list.md
 	verbose debug messages.
 
 *-no-xwayland*
-	Disable xwayland at runtime even if river has been built with support.
+	Disable Xwayland at runtime even if river has been built with support.
 
 # KEYBINDINGS
 
 The following keybindings are always active:
 
-*Ctrl+Alt+Delete*
-	Exit river
-
 *Ctrl+Alt+F1* - *Ctrl+Alt+F12*
 	Switch to VT 1-12
 
diff --git a/river/KeyboardGroup.zig b/river/KeyboardGroup.zig
index df6f9d3..cd90628 100644
--- a/river/KeyboardGroup.zig
+++ b/river/KeyboardGroup.zig
@@ -232,7 +232,7 @@ fn handleKey(listener: *wl.Listener(*wlr.Keyboard.event.Key), event: *wlr.Keyboa
         const xkb_keycode = event.keycode + 8;
         const modifiers = group.state.getModifiers();
         for (xkb_state.keyGetSyms(xkb_keycode)) |sym| {
-            if (handleBuiltinBinding(sym, modifiers)) {
+            if (handleBuiltinBinding(sym)) {
                 log.debug("matched builtin binding", .{});
                 break :blk .builtin;
             }
@@ -363,7 +363,7 @@ fn handleModifiers(listener: *wl.Listener(*wlr.Keyboard), _: *wlr.Keyboard) void
 
 /// Handle any builtin, hardcoded compositor keybindings such as VT switching.
 /// Returns true if the keysym was handled.
-fn handleBuiltinBinding(keysym: xkb.Keysym, modifiers: wlr.Keyboard.ModifierMask) bool {
+fn handleBuiltinBinding(keysym: xkb.Keysym) bool {
     switch (@intFromEnum(keysym)) {
         xkb.Keysym.XF86Switch_VT_1...xkb.Keysym.XF86Switch_VT_12 => {
             log.debug("switch VT keysym received", .{});
@@ -374,15 +374,6 @@ fn handleBuiltinBinding(keysym: xkb.Keysym, modifiers: wlr.Keyboard.ModifierMask
             }
             return true;
         },
-        xkb.Keysym.Delete => {
-            if (modifiers == wlr.Keyboard.ModifierMask{ .ctrl = true, .alt = true }) {
-                log.debug("ctrl+alt+delete pressed, exiting...", .{});
-                server.wl_server.terminate();
-                return true;
-            } else {
-                return false;
-            }
-        },
         else => return false,
     }
 }