From 589d97c8365ca772442323f277a99dd9215a8344 Mon Sep 17 00:00:00 2001 From: candifloss Date: Fri, 12 Dec 2025 11:33:07 +0530 Subject: [PATCH] Fix space reservation - Override window management to avoid reserving space or moving other windows --- crates/popcorn/src/show_popup.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/popcorn/src/show_popup.rs b/crates/popcorn/src/show_popup.rs index 49b582d..a067e79 100644 --- a/crates/popcorn/src/show_popup.rs +++ b/crates/popcorn/src/show_popup.rs @@ -80,10 +80,17 @@ fn set_ui_props( /// Create and display the OSD popup window. /// Loads config, applies X11 window attributes, sets UI props, and runs the Slint event loop. pub fn show_popup(args: &OsdArgs) -> Result<(), Box> { + // Load configs. let cfg = PopcornConfig::load_or_default(); - // Mark the window as a dock-type override window so WMs treat it like an OSD layer. - let window_attrs = |attrs: WindowAttributes| attrs.with_x11_window_type(vec![WindowType::Dock]); + // Configure X11 window attributes before Slint creates the window. + let window_attrs = |attrs: WindowAttributes| { + attrs + // Present the window as a dock so most WMs avoid decorations and normal window rules. + .with_x11_window_type(vec![WindowType::Dock]) + // Make the window unmanaged. This prevents tiling WMs from reserving space or moving it. + .with_override_redirect(true) + }; // Build and activate backend with X11 window-attribute hook. let backend = Backend::builder() @@ -95,6 +102,8 @@ pub fn show_popup(args: &OsdArgs) -> Result<(), Box> { let ui = OSDpopup::new()?; set_ui_props(&ui, &cfg, args)?; + // Run! ui.run()?; + Ok(()) }