tony / oxwm

feat: Fullscreen mode implemntation Browse files
xsoder committed 2025-10-09 parent 2342897 commit 6b9ab97cb306cfb9e780c8ea0a0014ff9ea6b878
Showing 1 changed file with 1 additions and 7 deletions. UnifiedSplit
+1 −7 src/window_manager.rs
@@ -283,23 +283,17 @@ impl WindowManager {
283 fn toggle_fullscreen(&mut self) -> Result<()> { 283 fn toggle_fullscreen(&mut self) -> Result<()> {
284 if let Some(focused) = self.focused_window { 284 if let Some(focused) = self.focused_window {
285 if self.fullscreen_window == Some(focused) { 285 if self.fullscreen_window == Some(focused) {
286 - // Exit fullscreen
287 self.fullscreen_window = None; 286 self.fullscreen_window = None;
288 287
289 - // Show bar
290 self.connection.map_window(self.bar.window())?; 288 self.connection.map_window(self.bar.window())?;
291 289
292 - // Restore normal layout
293 self.apply_layout()?; 290 self.apply_layout()?;
294 self.update_focus_visuals()?; 291 self.update_focus_visuals()?;
295 } else { 292 } else {
296 - // Enter fullscreen
297 self.fullscreen_window = Some(focused); 293 self.fullscreen_window = Some(focused);
298 294
299 - // Hide bar
300 self.connection.unmap_window(self.bar.window())?; 295 self.connection.unmap_window(self.bar.window())?;
301 296
302 - // Make window fill entire screen
303 let screen_width = self.screen.width_in_pixels as u32; 297 let screen_width = self.screen.width_in_pixels as u32;
304 let screen_height = self.screen.height_in_pixels as u32; 298 let screen_height = self.screen.height_in_pixels as u32;
305 299
@@ -311,7 +305,7 @@ impl WindowManager {
311 .width(screen_width) 305 .width(screen_width)
312 .height(screen_height) 306 .height(screen_height)
313 .border_width(0) 307 .border_width(0)
314 - .stack_mode(StackMode::ABOVE), // This raises the window 308 + .stack_mode(StackMode::ABOVE),
315 )?; 309 )?;
316 310
317 self.connection.flush()?; 311 self.connection.flush()?;