Skip to content

Commit

Permalink
Fix extra client_mouse_enter events (#4537)
Browse files Browse the repository at this point in the history
* Fix extra client_mouse_enter events

The Wayland core was emitting client_mouse_enter event on every mouse motion
over a non-focused client.

* Rearrange flow control logic

---------

Co-authored-by: Joe Rabinoff <rabinoff@post.harvard.edu>
  • Loading branch information
QBobWatson and Joe Rabinoff committed Oct 24, 2023
1 parent 2347e18 commit eb6310a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions libqtile/backend/wayland/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,20 +984,15 @@ def _focus_pointer(self, cx: int, cy: int, motion: int | None = None) -> None:
self.seat.pointer_notify_clear_focus()

if win is not self.qtile.current_window:
if isinstance(win, window.Static):
if self._hovered_window is not win:
# qtile.current_window will never be a static window, but we
# still only want to fire client_mouse_enter once, so check
# self._hovered_window.
hook.fire("client_mouse_enter", win)

if motion is not None and self.qtile.config.follow_mouse_focus:
self.qtile.focus_screen(win.screen.index, False)

else:
if self._hovered_window is not win:
# We only want to fire client_mouse_enter once, so check
# self._hovered_window.
hook.fire("client_mouse_enter", win)

if motion is not None and self.qtile.config.follow_mouse_focus:
if motion is not None and self.qtile.config.follow_mouse_focus:
if isinstance(win, window.Static):
self.qtile.focus_screen(win.screen.index, False)
else:
if win.group and win.group.current_window != win:
win.group.focus(win, False)
if (
Expand Down

0 comments on commit eb6310a

Please sign in to comment.