switch focus when mouse is entering a workspace
but not moving into a window (w' == 0)

for magic number 0 in w' == 0
see discussion in https://github.com/xmonad/xmonad/pull/88#pullrequestreview-62489502
This commit is contained in:
Javran Cheng
2017-09-13 19:21:56 -04:00
parent 2e6312776b
commit 462957b2f0
2 changed files with 7 additions and 1 deletions

View File

@@ -14,6 +14,10 @@
- Focus did not follow when moving between workspaces (#87)
- etc.
* Recover old behavior (in 0.12) when `focusFollowsMouse == True`:
the focus follows when the mouse enters another workspace
but not moving into any window.
## 0.13 (February 10, 2017)
### Breaking Changes

View File

@@ -368,7 +368,9 @@ handle e@(CrossingEvent {ev_window = w, ev_event_type = t})
dpy <- asks display
root <- asks theRoot
(_, _, w', _, _, _, _, _) <- io $ queryPointer dpy root
when (w == w') (focus w)
-- when Xlib cannot find a child that contains the pointer,
-- it returns None(0)
when (w' == 0 || w == w') (focus w)
-- left a window, check if we need to focus root
handle e@(CrossingEvent {ev_event_type = t})