Override window management

- No space reserved
- No window moving or tiling
This commit is contained in:
Candifloss 2025-12-12 19:14:09 +05:30
parent b559463d09
commit 17bc14e08e

View File

@ -79,10 +79,13 @@ fn set_ui_props(ui: &MainWindow, resp: &WeatherResponse, cfg: &Config) {
/// Create and show the Window UI
pub fn show_popup(resp: &WeatherResponse, cfg: &Config) -> Result<(), Box<dyn std::error::Error>> {
// Closure that adjusts winit WindowAttributes before Slint creates the window.
// Closure to configure X11 window attributes before Slint creates the window.
let window_attrs = |attrs: WindowAttributes| {
// Mark the X11 window as a DOCK so the WM doesn't treat it as a normal window
attrs.with_x11_window_type(vec![WindowType::Dock])
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 a Slint backend that applies this attribute hook to all windows.