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

commitc416cdc29212a010281d844782a2e8ca6481bdcb
parentf19d43bd77
authorLucas Galante <[email protected]>
date2026-05-28 20:14
Add no-op handlers for inert River resources to prevent NULL listener aborts

 src/layer_shell.rs  |  7 +++++-
 src/seat.rs         | 65 ++++++++++++++++++++++++++++++++++++++++++++++-------
 src/xkb_bindings.rs | 22 +++++++++++++++---
 3 files changed, 82 insertions(+), 12 deletions(-)

diff --git a/src/layer_shell.rs b/src/layer_shell.rs
index 3ee16de..aa8e837 100644
--- a/src/layer_shell.rs
+++ b/src/layer_shell.rs
@@ -773,9 +773,14 @@ static LAYER_SHELL_OUTPUT_INTERFACE: ffi::river_layer_shell_output_v1_interface
     set_default: Some(layer_shell_output_set_default),
 };
 
+unsafe extern "C" fn layer_shell_output_inert_set_default(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+) {}
+
 static INERT_LAYER_SHELL_OUTPUT_INTERFACE: ffi::river_layer_shell_output_v1_interface = ffi::river_layer_shell_output_v1_interface {
     destroy: Some(layer_shell_output_destroy),
-    set_default: None,
+    set_default: Some(layer_shell_output_inert_set_default),
 };
 
 unsafe fn container_of_output(layer_shell_output: *mut LayerShellOutput) -> *mut Output {
diff --git a/src/seat.rs b/src/seat.rs
index f0bec50..b35791e 100644
--- a/src/seat.rs
+++ b/src/seat.rs
@@ -1061,16 +1061,65 @@ static SEAT_INTERFACE: ffi::river_seat_v1_interface = ffi::river_seat_v1_interfa
     pointer_warp: Some(seat_pointer_warp),
 };
 
+unsafe extern "C" fn seat_inert_focus_window(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+    _window_resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn seat_inert_focus_shell_surface(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+    _shell_surface_resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn seat_inert_clear_focus(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn seat_inert_op_start_pointer(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn seat_inert_op_end(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn seat_inert_get_pointer_binding(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+    _id: u32,
+    _button: u32,
+    _modifiers: u32,
+) {}
+
+unsafe extern "C" fn seat_inert_set_xcursor_theme(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+    _name: *const ::std::os::raw::c_char,
+    _size: u32,
+) {}
+
+unsafe extern "C" fn seat_inert_pointer_warp(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+    _x: i32,
+    _y: i32,
+) {}
+
 static INERT_SEAT_INTERFACE: ffi::river_seat_v1_interface = ffi::river_seat_v1_interface {
     destroy: Some(seat_destroy),
-    focus_window: None,
-    focus_shell_surface: None,
-    clear_focus: None,
-    op_start_pointer: None,
-    op_end: None,
-    get_pointer_binding: None,
-    set_xcursor_theme: None,
-    pointer_warp: None,
+    focus_window: Some(seat_inert_focus_window),
+    focus_shell_surface: Some(seat_inert_focus_shell_surface),
+    clear_focus: Some(seat_inert_clear_focus),
+    op_start_pointer: Some(seat_inert_op_start_pointer),
+    op_end: Some(seat_inert_op_end),
+    get_pointer_binding: Some(seat_inert_get_pointer_binding),
+    set_xcursor_theme: Some(seat_inert_set_xcursor_theme),
+    pointer_warp: Some(seat_inert_pointer_warp),
 };
 
 unsafe extern "C" fn handle_destroy_resource(resource: *mut ffi::wl_resource) {
diff --git a/src/xkb_bindings.rs b/src/xkb_bindings.rs
index f15d81e..ef82cfd 100644
--- a/src/xkb_bindings.rs
+++ b/src/xkb_bindings.rs
@@ -130,11 +130,27 @@ static XKB_BINDINGS_SEAT_INTERFACE: ffi::river_xkb_bindings_seat_v1_interface =
     modifiers_watch: Some(bindings_seat_modifiers_watch),
 };
 
+unsafe extern "C" fn bindings_seat_inert_ensure_next_key_eaten(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn bindings_seat_inert_cancel_ensure_next_key_eaten(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+) {}
+
+unsafe extern "C" fn bindings_seat_inert_modifiers_watch(
+    _client: *mut ffi::wl_client,
+    _resource: *mut ffi::wl_resource,
+    _modifiers: u32,
+) {}
+
 static INERT_XKB_BINDINGS_SEAT_INTERFACE: ffi::river_xkb_bindings_seat_v1_interface = ffi::river_xkb_bindings_seat_v1_interface {
     destroy: Some(bindings_seat_destroy),
-    ensure_next_key_eaten: None,
-    cancel_ensure_next_key_eaten: None,
-    modifiers_watch: None,
+    ensure_next_key_eaten: Some(bindings_seat_inert_ensure_next_key_eaten),
+    cancel_ensure_next_key_eaten: Some(bindings_seat_inert_cancel_ensure_next_key_eaten),
+    modifiers_watch: Some(bindings_seat_inert_modifiers_watch),
 };
 
 unsafe extern "C" fn bindings_seat_destroy(