aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
authorJim Ramsay <jim.ramsay@motorola.com>2010-05-28 19:50:15 (GMT)
committerJim Ramsay <jim.ramsay@motorola.com>2010-05-28 19:50:15 (GMT)
commit37a24132b5cd444fca025259f05618eec52935b2 (patch)
treeb6f64add5a665666996857a02150ebe3cac082a7 /src/FocusControl.cc
parentcdbaf5c04d07e8310c661e12e354724a619e5911 (diff)
downloadfluxbox-37a24132b5cd444fca025259f05618eec52935b2.zip
fluxbox-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.cc19
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
404void FocusControl::ignoreAtPointer() 404void 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
418void 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
416void FocusControl::ignoreAt(int x, int y) 425void 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
421bool FocusControl::isIgnored(int x, int y) 430bool FocusControl::isIgnored(int x, int y)