gardesk/gar / 3f64b12

Browse files

hide frame borders on fullscreen windows

Authored by espadonne
SHA
3f64b128c5b1ba3637572452b4c36c5a8394f4d6
Parents
6c08b3a
Tree
f700d65

1 changed file

StatusFile+-
M gar/src/core/mod.rs 41 13
gar/src/core/mod.rsmodified
@@ -832,6 +832,11 @@ impl WindowManager {
832832
         // Update borders for all windows on visible workspaces
833833
         for ws_idx in visible_ws {
834834
             for window in self.workspaces[ws_idx].all_windows() {
835
+                // Fullscreen windows have no borders
836
+                if self.windows.get(&window).map(|w| w.fullscreen).unwrap_or(false) {
837
+                    continue;
838
+                }
839
+
835840
                 // Check if window is urgent (and not focused - focused clears urgency)
836841
                 let is_urgent = self.windows.get(&window)
837842
                     .map(|w| w.urgent && Some(window) != focused)
@@ -911,19 +916,42 @@ impl WindowManager {
911916
                     fs_window, screen
912917
                 );
913918
 
914
-                // Configure fullscreen window to cover entire monitor (no gaps, no borders)
915
-                self.conn.configure_window(
916
-                    fs_window,
917
-                    screen.x,
918
-                    screen.y,
919
-                    screen.width,
920
-                    screen.height,
921
-                    0, // No border for fullscreen
922
-                )?;
923
-
924
-                // Raise fullscreen window above everything
925
-                let aux = ConfigureWindowAux::new().stack_mode(StackMode::ABOVE);
926
-                self.conn.conn.configure_window(fs_window, &aux)?;
919
+                if let Some(frame) = self.frames.frame_for_client(fs_window) {
920
+                    // Window has a frame — position frame at monitor origin with no border,
921
+                    // and configure client to fill the entire frame.
922
+                    let frame_aux = ConfigureWindowAux::new()
923
+                        .x(screen.x as i32)
924
+                        .y(screen.y as i32)
925
+                        .width(screen.width as u32)
926
+                        .height(screen.height as u32)
927
+                        .border_width(0);
928
+                    self.conn.conn.configure_window(frame, &frame_aux)?;
929
+
930
+                    let client_aux = ConfigureWindowAux::new()
931
+                        .x(0)
932
+                        .y(0)
933
+                        .width(screen.width as u32)
934
+                        .height(screen.height as u32)
935
+                        .border_width(0);
936
+                    self.conn.conn.configure_window(fs_window, &client_aux)?;
937
+
938
+                    // Raise frame above everything
939
+                    let aux = ConfigureWindowAux::new().stack_mode(StackMode::ABOVE);
940
+                    self.conn.conn.configure_window(frame, &aux)?;
941
+                } else {
942
+                    // No frame — configure client directly
943
+                    self.conn.configure_window(
944
+                        fs_window,
945
+                        screen.x,
946
+                        screen.y,
947
+                        screen.width,
948
+                        screen.height,
949
+                        0,
950
+                    )?;
951
+
952
+                    let aux = ConfigureWindowAux::new().stack_mode(StackMode::ABOVE);
953
+                    self.conn.conn.configure_window(fs_window, &aux)?;
954
+                }
927955
 
928956
                 // Skip normal layout for this workspace - fullscreen window covers everything
929957
                 continue;