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

commitcfb9b269579f7bb1c77b85e0334b5b042aaf9536
parent72b21efbe7
authorLucas Galante <[email protected]>
date2026-06-28 23:07
Update server status bar reference and tiling logic for cce-status

 src/server/layer_shell.rs    | 11 ++++++++++-
 src/server/status_server.rs  |  2 +-
 src/server/window.rs         | 11 ++++++-----
 src/server/window_manager.rs | 14 +++++++-------
 4 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/src/server/layer_shell.rs b/src/server/layer_shell.rs
index 12b90a4..e678353 100644
--- a/src/server/layer_shell.rs
+++ b/src/server/layer_shell.rs
@@ -547,7 +547,16 @@ unsafe extern "C" fn handle_layer_surface_unmap(listener: *mut ffi::wl_listener,
             if let crate::seat::Focus::LayerSurface(surface) = (*seat).focused {
                 if surface == (*wlr_layer_surface).surface {
                     (*seat).focus(crate::seat::Focus::None);
-                    (*server).wm.focus_next_visible_window(seat);
+                    let mut is_cce_cloud = false;
+                    if !(*wlr_layer_surface).namespace.is_null() {
+                        let ns = std::ffi::CStr::from_ptr((*wlr_layer_surface).namespace).to_string_lossy();
+                        if ns == "cce-cloud" {
+                            is_cce_cloud = true;
+                        }
+                    }
+                    if !is_cce_cloud {
+                        (*server).wm.focus_next_visible_window(seat);
+                    }
                 }
             }
             if let LayerShellSeatFocus::NonExclusive(key) = (*seat).layer_shell.scheduled_focus {
diff --git a/src/server/status_server.rs b/src/server/status_server.rs
index 841fd72..a409618 100644
--- a/src/server/status_server.rs
+++ b/src/server/status_server.rs
@@ -1,6 +1,6 @@
 // Status socket server for monolithic cce server
 //
-// Runs in a dedicated thread. cce-status-interface connects to
+// Runs in a dedicated thread. cce-status connects to
 // /tmp/cce-status-{WAYLAND_DISPLAY}.sock, sends a subscription line
 // ("viewport", "layout", or "title"), and receives JSON lines whenever the status changes.
 //
diff --git a/src/server/window.rs b/src/server/window.rs
index 87b4e4f..04fe070 100644
--- a/src/server/window.rs
+++ b/src/server/window.rs
@@ -270,7 +270,7 @@ impl Window {
     }
 
     pub unsafe fn is_status_bar(&self) -> bool {
-        self.get_app_id_string().as_deref() == Some("cce-status-interface")
+        self.get_app_id_string().as_deref() == Some("cce-status")
     }
 
 
@@ -630,7 +630,7 @@ impl Window {
             return;
         }
         let app_id_str = self.get_app_id_string().unwrap_or_default();
-        if app_id_str.is_empty() || app_id_str == "cce-status-interface" {
+        if app_id_str.is_empty() || app_id_str == "cce-status" {
             return;
         }
         let title_str = self.get_title_string().unwrap_or_default();
@@ -697,7 +697,7 @@ impl Window {
         let app_id_ptr = self.get_app_id();
         let is_status_bar = if !app_id_ptr.is_null() {
             let app_id = std::ffi::CStr::from_ptr(app_id_ptr).to_string_lossy();
-            app_id == "cce-status-interface"
+            app_id == "cce-status"
         } else {
             false
         };
@@ -800,6 +800,7 @@ impl Window {
             if let crate::seat::Focus::Window(w) = (*seat).focused {
                 if w == window {
                     (*seat).focus(crate::seat::Focus::None);
+                    (*(*window).server).wm.focus_next_visible_window(seat);
                 }
             }
             curr = next;
@@ -1482,7 +1483,7 @@ impl Window {
 
     pub unsafe fn notify_app_id(&mut self) {
         self.wm_scheduled.dirty_app_id = true;
-        if self.get_app_id_string().as_deref() == Some("cce-status-interface") {
+        if self.get_app_id_string().as_deref() == Some("cce-status") {
             self.tiling_mode = crate::tiling::TilingMode::Status;
         }
         self.try_restore();
@@ -1667,7 +1668,7 @@ impl Window {
             let app_id_ptr = self.get_app_id();
             let is_status_bar = if !app_id_ptr.is_null() {
                 let app_id = std::ffi::CStr::from_ptr(app_id_ptr).to_string_lossy();
-                app_id == "cce-status-interface"
+                app_id == "cce-status"
             } else {
                 false
             };
diff --git a/src/server/window_manager.rs b/src/server/window_manager.rs
index 7ac9260..ddfd702 100644
--- a/src/server/window_manager.rs
+++ b/src/server/window_manager.rs
@@ -997,7 +997,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
                 }
 
                 let app_id = (*win_ptr).get_app_id_string();
-                let is_status_bar = app_id.as_deref() == Some("cce-status-interface");
+                let is_status_bar = app_id.as_deref() == Some("cce-status");
                 
                 if is_status_bar {
                     (*win_ptr).tiling_mode = crate::tiling::TilingMode::Status;
@@ -1354,7 +1354,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
                     }
                 }
                 crate::seat::Focus::None => {
-                    focused_visible = false;
+                    focused_visible = true;
                 }
                 _ => {
                     focused_visible = true;
@@ -1442,7 +1442,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
         for &w in self.focus_history.iter() {
             if !w.is_null() && !(*w).closed && !(*w).minimized && matches!((*w).state, crate::window::WindowState::Mapped) {
                 let app_id = (*w).get_app_id_string();
-                let is_status_bar = app_id.as_deref() == Some("cce-status-interface");
+                let is_status_bar = app_id.as_deref() == Some("cce-status");
                 if !is_status_bar {
                     next_focus = w;
                     break;
@@ -1453,7 +1453,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
             for &w in self.windows.iter() {
                 if !w.is_null() && !(*w).closed && !(*w).minimized && matches!((*w).state, crate::window::WindowState::Mapped) {
                     let app_id = (*w).get_app_id_string();
-                    let is_status_bar = app_id.as_deref() == Some("cce-status-interface");
+                    let is_status_bar = app_id.as_deref() == Some("cce-status");
                     if !is_status_bar {
                         next_focus = w;
                     }
@@ -1477,7 +1477,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
                 continue;
             }
             if let Some(app_id) = (*win_ptr).get_app_id_string() {
-                if app_id == "cce-status-interface" {
+                if app_id == "cce-status" {
                     status_bar_windows.push(win_ptr);
                 }
             }
@@ -1629,7 +1629,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
                         if let crate::wm_node::WmNodeType::Window(window) = (*node).get() {
                             if !window.is_null() && !(*window).closed && !(*window).minimized {
                                 let is_status_bar = (*window).get_app_id_string()
-                                    .map_or(false, |aid| aid == "cce-status-interface");
+                                    .map_or(false, |aid| aid == "cce-status");
                                 if !is_status_bar {
                                     visible_windows.push(window);
                                 }
@@ -1899,7 +1899,7 @@ fn get_closest_tag(x: f64, y: f64) -> i32 {
                         }
 
                         let app_id = (*win_ptr).get_app_id_string();
-                        let is_status_bar = app_id.as_deref() == Some("cce-status-interface");
+                        let is_status_bar = app_id.as_deref() == Some("cce-status");
                         if is_status_bar {
                             continue;
                         }