feat(widgets): enhance mouse capture handling and dropdown escape keybinding

Why: Refactor mouse capture logic to use robust input‑region handling, add support for multi‑click events, and align layer usage with the passed layer parameter; update dropdown to use an Escape keybinding instead of a button‑press hide.

New Features:
- Support button‑press, double‑click, and triple‑click events.
- Introduce `_get_child_window_bounds` helper and window‑local coordinate detection for accurate click placement.
- Add cursor‑feedback styling updates on the trigger widget.

Enhancements:
- Make overlay layer configurable via the passed `layer` argument.
- Replace direct `button-press-event` connection with an Escape keybinding in the dropdown.
- Update imports to use `Gdk` and new utilities (`HyprlandWithMonitors`, `modus_service`).

Bug Fixes:
- Resolve race condition that could hide child windows on external clicks.
- Ensure immediate hide when clicking outside the child window to avoid timing issues.
- Correct click‑inside detection logic and properly consume events.
This commit is contained in:
sankalp committed 2026-04-10 01:13:23 +05:45
1 parent cb2e6053f2
commit 38de0c66ed
2 files changed
+187 -27

No files matched your search

-1
View File
@@ -51,7 +51,6 @@ class ModusDropdown(PopupWindow):
)
self.children = [self.event_box]
self.connect("button-press-event", self.hide_dropdown)
self.add_keybinding("Escape", self.hide_dropdown)
def toggle_dropdown(self, button, parent=None):