diff options
author | Jim Ramsay <jim.ramsay@motorola.com> | 2010-05-28 19:50:15 (GMT) |
---|---|---|
committer | Jim Ramsay <jim.ramsay@motorola.com> | 2010-05-28 19:50:15 (GMT) |
commit | 37a24132b5cd444fca025259f05618eec52935b2 (patch) | |
tree | b6f64add5a665666996857a02150ebe3cac082a7 /src/FocusControl.cc | |
parent | cdbaf5c04d07e8310c661e12e354724a619e5911 (diff) | |
download | fluxbox_pavel-37a24132b5cd444fca025259f05618eec52935b2.zip fluxbox_pavel-37a24132b5cd444fca025259f05618eec52935b2.tar.bz2 |
Implement StrictMouseFocus
As noted in the previous commit, StrictMouseFocus now works as advertised:
Focus follows mouse on every EnterNotify event (except when the "ClientMenu"
closes or during alt+tab window cycling)
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r-- | src/FocusControl.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc index eeacc3b..63ca773 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc | |||
@@ -401,21 +401,30 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) { | |||
401 | 401 | ||
402 | } | 402 | } |
403 | 403 | ||
404 | void FocusControl::ignoreAtPointer() | 404 | void FocusControl::ignoreAtPointer(bool force) |
405 | { | 405 | { |
406 | int ignore_i; | 406 | int ignore_i, ignore_x, ignore_y; |
407 | unsigned int ignore_ui; | 407 | unsigned int ignore_ui; |
408 | Window ignore_w; | 408 | Window ignore_w; |
409 | 409 | ||
410 | XQueryPointer(m_screen.rootWindow().display(), | 410 | XQueryPointer(m_screen.rootWindow().display(), |
411 | m_screen.rootWindow().window(), &ignore_w, &ignore_w, | 411 | m_screen.rootWindow().window(), &ignore_w, &ignore_w, |
412 | &m_ignore_mouse_x, &m_ignore_mouse_y, | 412 | &ignore_x, &ignore_y, |
413 | &ignore_i, &ignore_i, &ignore_ui); | 413 | &ignore_i, &ignore_i, &ignore_ui); |
414 | |||
415 | this->ignoreAt(ignore_x, ignore_y, force); | ||
416 | } | ||
417 | |||
418 | void FocusControl::ignoreAt(int x, int y, bool force) | ||
419 | { | ||
420 | if (force || this->focusModel() == MOUSEFOCUS) { | ||
421 | m_ignore_mouse_x = x; m_ignore_mouse_y = y; | ||
422 | } | ||
414 | } | 423 | } |
415 | 424 | ||
416 | void FocusControl::ignoreAt(int x, int y) | 425 | void FocusControl::ignoreCancel() |
417 | { | 426 | { |
418 | m_ignore_mouse_x = x; m_ignore_mouse_y = y; | 427 | m_ignore_mouse_x = m_ignore_mouse_y = -1; |
419 | } | 428 | } |
420 | 429 | ||
421 | bool FocusControl::isIgnored(int x, int y) | 430 | bool FocusControl::isIgnored(int x, int y) |