From 63bd7cfea9c0dc9dea648c9df194a7a008e875cf Mon Sep 17 00:00:00 2001 From: nevaforget Date: Fri, 27 Mar 2026 14:35:40 +0100 Subject: [PATCH] feat: panel on focused monitor, wallpaper on all others Panel without set_monitor so compositor places it on focused output. Wallpaper windows on TOP layer on all monitors (below OVERLAY panel). Transparent confirmation dialog background. --- src/moonset/main.py | 31 ++++++++++++++++++++----------- src/moonset/style.css | 3 +-- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/moonset/main.py b/src/moonset/main.py index 8c3931a..bb9b750 100644 --- a/src/moonset/main.py +++ b/src/moonset/main.py @@ -58,7 +58,6 @@ class MoonsetApp(Gtk.Application): def __init__(self) -> None: super().__init__(application_id="dev.moonarch.moonset") - self._windows: list[PanelWindow] = [] def do_activate(self) -> None: """Create and present power menu windows on all monitors.""" @@ -73,17 +72,24 @@ class MoonsetApp(Gtk.Application): config = load_config() bg_path = resolve_background_path(config) - # Panel window on every monitor — keyboard exclusive on all so - # the focused monitor always captures input + # Panel on focused output (no set_monitor → compositor picks focused) + panel = PanelWindow(bg_path=bg_path, application=self) + if HAS_LAYER_SHELL: + self._setup_layer_shell(panel, keyboard=True) + panel.present() + + # Wallpaper on all other monitors monitors = display.get_monitors() for i in range(monitors.get_n_items()): monitor = monitors.get_item(i) - panel = PanelWindow(bg_path=bg_path, application=self) + wallpaper = WallpaperWindow(bg_path=bg_path, application=self) if HAS_LAYER_SHELL: - self._setup_layer_shell(panel, keyboard=True) - Gtk4LayerShell.set_monitor(panel, monitor) - panel.present() - self._windows.append(panel) + self._setup_layer_shell( + wallpaper, keyboard=False, + layer=Gtk4LayerShell.Layer.TOP, + ) + Gtk4LayerShell.set_monitor(wallpaper, monitor) + wallpaper.present() def _load_css(self, display: Gdk.Display) -> None: """Load the CSS stylesheet for the power menu.""" @@ -97,11 +103,14 @@ class MoonsetApp(Gtk.Application): ) def _setup_layer_shell( - self, window: Gtk.Window, keyboard: bool = False + self, window: Gtk.Window, keyboard: bool = False, + layer: int | None = None, ) -> None: - """Configure gtk4-layer-shell for fullscreen OVERLAY display.""" + """Configure gtk4-layer-shell for fullscreen display.""" Gtk4LayerShell.init_for_window(window) - Gtk4LayerShell.set_layer(window, Gtk4LayerShell.Layer.OVERLAY) + Gtk4LayerShell.set_layer( + window, layer if layer is not None else Gtk4LayerShell.Layer.OVERLAY + ) Gtk4LayerShell.set_exclusive_zone(window, -1) if keyboard: Gtk4LayerShell.set_keyboard_mode( diff --git a/src/moonset/style.css b/src/moonset/style.css index da60a2b..fd9283b 100644 --- a/src/moonset/style.css +++ b/src/moonset/style.css @@ -61,8 +61,7 @@ window.wallpaper { /* Confirmation box below action buttons */ .confirm-box { padding: 16px 24px; - border-radius: 12px; - background-color: @theme_base_color; + background-color: transparent; } /* Confirmation prompt text */