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

commit662beda61b9efd8eccd51fe40c0562d76991accf
parent5b1103f799
authorLucas Galante <[email protected]>
date2026-06-19 15:29
Allow clients to get toplevel and set popup mode without hijacking active WM

 src/server/window_manager.rs | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/src/server/window_manager.rs b/src/server/window_manager.rs
index 520c6f3..ae501cd 100644
--- a/src/server/window_manager.rs
+++ b/src/server/window_manager.rs
@@ -2176,26 +2176,14 @@ unsafe extern "C" fn bind(
         return;
     }
 
-    if !(*wm).object.is_null() {
-        log::warn!("zcce_window_manager_v1 already bound, rejecting new client PID={}", pid);
-        ffi::wl_resource_post_event(resource, ffi::ZCCE_WINDOW_MANAGER_V1_UNAVAILABLE);
-        ffi::wl_resource_set_implementation(
-            resource,
-            &INERT_WM_INTERFACE as *const _ as *const _,
-            std::ptr::null_mut(),
-            None,
-        );
-        return;
-    }
-
-    (*wm).object = resource;
+    // We do not set (*wm).object = resource, so the built-in window manager remains active.
+    // We just set the implementation to WM_INTERFACE so the client can call get_cce_toplevel.
     ffi::wl_resource_set_implementation(
         resource,
         &WM_INTERFACE as *const _ as *const _,
         wm as *mut _,
-        Some(handle_destroy_wm_resource),
+        None,
     );
-    (*wm).dirty_windowing();
 }
 
 unsafe extern "C" fn handle_destroy_wm_resource(resource: *mut ffi::wl_resource) {