From ede812c74081c95588bc30e7297fdfc12377d45c Mon Sep 17 00:00:00 2001 From: The_miro Date: Thu, 20 Aug 2026 16:12:46 +0200 Subject: [PATCH] fix(station-bar): reserve the bar's whole surface so it stops eating clicks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CyberQueer GTK4 theme puts `padding: 20px` on the `window` node, which inflated the layer surface from BAR_HEIGHT (44px) to 84px. The extra 40px is transparent but still part of the surface's input region, and only 44px were reserved as the exclusive zone — so the bar hovered over the top of every window below and swallowed clicks there (e.g. Firefox's address bar). Zero the window node's padding/margin/border in the bar's own USER+1 stylesheet, and swap the hardcoded set_exclusive_zone(BAR_HEIGHT) for auto_exclusive_zone_enable() so the reserved zone tracks the real surface height whatever the theme does. Verified: surface and reserved are both 44px on all three outputs, and the D-Bus hide/show toggle still releases and restores the zone. Co-Authored-By: Claude Opus 5 --- desktopenvs/hyprdrive/station-bar/bar.py | 13 +++++++++++-- desktopenvs/hyprdrive/station-bar/style/style.css | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/desktopenvs/hyprdrive/station-bar/bar.py b/desktopenvs/hyprdrive/station-bar/bar.py index 275ddd0..6ca4f05 100644 --- a/desktopenvs/hyprdrive/station-bar/bar.py +++ b/desktopenvs/hyprdrive/station-bar/bar.py @@ -216,7 +216,14 @@ class StationBar(Gtk.Window): for edge in (LayerShell.Edge.LEFT, LayerShell.Edge.RIGHT, LayerShell.Edge.TOP): LayerShell.set_anchor(self, edge, True) LayerShell.set_margin(self, edge, 0) - LayerShell.set_exclusive_zone(self, self.BAR_HEIGHT) + # Reserve the surface's REAL height, not the BAR_HEIGHT constant: the + # layer surface can end up taller than the strip we draw (the GTK theme + # adds padding to the `window` node, CSS may grow a widget, ...) and any + # pixel of surface beyond the exclusive zone still swallows clicks while + # sitting on top of a window — that's what ate clicks on Firefox's + # address bar. auto-exclusive keeps zone == height on every resize, so + # the bar always blocks exactly the area it covers. + LayerShell.auto_exclusive_zone_enable(self) def _monitor_connector(self) -> Optional[str]: """The Gdk connector name (e.g. "DP-1"), which equals the Hyprland @@ -573,7 +580,9 @@ class StationBar(Gtk.Window): # -- external control (D-Bus show/hide/toggle, see main.py) ------------------- def show_bar(self) -> None: - LayerShell.set_exclusive_zone(self, self.BAR_HEIGHT) + # set_exclusive_zone(0) in _finish_hide() turned auto-exclusive off; the + # re-enable both restores the reservation and re-syncs it to the height. + LayerShell.auto_exclusive_zone_enable(self) self.set_visible(True) self.present() self._ensure_tick() diff --git a/desktopenvs/hyprdrive/station-bar/style/style.css b/desktopenvs/hyprdrive/station-bar/style/style.css index 0c331ca..061abf2 100644 --- a/desktopenvs/hyprdrive/station-bar/style/style.css +++ b/desktopenvs/hyprdrive/station-bar/style/style.css @@ -37,6 +37,21 @@ drawingarea { background: transparent; } +/* The surface must be exactly BAR_HEIGHT tall. The CyberQueer GTK theme puts + * `padding: 20px` on the `window` node, which inflated the layer surface to + * 44+40 = 84px; the extra 40px is invisible (transparent) but still part of + * the bar's input region, so it hovered over the top of windows and ate their + * clicks — e.g. Firefox's address bar. Zero it out here; bar.py additionally + * reserves the surface's real height via auto-exclusive-zone. */ +.station-bar-window { + padding: 0; + margin: 0; + border: none; + box-shadow: none; + min-width: 0; + min-height: 0; +} + /* Neutralise the CyberQueer GTK theme's `* { background-color:#1a1a1a }` on * every node — enumerating node names above misses some (labels, the CenterBox * boxes). This provider is at USER+1, above the theme; interactive elements