fix(station-bar): reserve the bar's whole surface so it stops eating clicks
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 <noreply@anthropic.com>main
parent
268feaa1f2
commit
ede812c740
|
|
@ -216,7 +216,14 @@ class StationBar(Gtk.Window):
|
||||||
for edge in (LayerShell.Edge.LEFT, LayerShell.Edge.RIGHT, LayerShell.Edge.TOP):
|
for edge in (LayerShell.Edge.LEFT, LayerShell.Edge.RIGHT, LayerShell.Edge.TOP):
|
||||||
LayerShell.set_anchor(self, edge, True)
|
LayerShell.set_anchor(self, edge, True)
|
||||||
LayerShell.set_margin(self, edge, 0)
|
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]:
|
def _monitor_connector(self) -> Optional[str]:
|
||||||
"""The Gdk connector name (e.g. "DP-1"), which equals the Hyprland
|
"""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) -------------------
|
# -- external control (D-Bus show/hide/toggle, see main.py) -------------------
|
||||||
def show_bar(self) -> None:
|
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.set_visible(True)
|
||||||
self.present()
|
self.present()
|
||||||
self._ensure_tick()
|
self._ensure_tick()
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,21 @@ drawingarea {
|
||||||
background: transparent;
|
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
|
/* Neutralise the CyberQueer GTK theme's `* { background-color:#1a1a1a }` on
|
||||||
* every node — enumerating node names above misses some (labels, the CenterBox
|
* every node — enumerating node names above misses some (labels, the CenterBox
|
||||||
* boxes). This provider is at USER+1, above the theme; interactive elements
|
* boxes). This provider is at USER+1, above the theme; interactive elements
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue