aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
authorJim Ramsay <i.am@jimramsay.com>2009-01-30 15:41:27 (GMT)
committerJim Ramsay <i.am@jimramsay.com>2009-02-27 20:18:07 (GMT)
commit5c7784affe78467d7ef4e52e22da83c341622d53 (patch)
treecbb83969ab422857bac498d51238789b0dfc6648 /src/FocusControl.cc
parente7700166604d737ff23427877100c8888c761494 (diff)
downloadfluxbox-5c7784affe78467d7ef4e52e22da83c341622d53.zip
fluxbox-5c7784affe78467d7ef4e52e22da83c341622d53.tar.bz2
Added facility to selectively ignore EnterNotify events
This will be used to avoid some situations where an EnterNotify event should not focus the window beneath the mouse cursor. For example, when a menu (or any window for that matter) is unmapped, focus should not pass to whatever window is beneath the current location of the mouse cursor, but to the previous window in the focus list. This was first noticed when using the ClientMenu feature with focus-follows-mouse on -> The focus would always end up on the window beneath the mouse pointer, not the window selected in the menu.
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 78752bb..701373b 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -81,7 +81,8 @@ FocusControl::FocusControl(BScreen &screen):
81 m_focused_win_list(screen), m_creation_order_win_list(screen), 81 m_focused_win_list(screen), m_creation_order_win_list(screen),
82 m_cycling_list(0), 82 m_cycling_list(0),
83 m_was_iconic(false), 83 m_was_iconic(false),
84 m_cycling_last(0) { 84 m_cycling_last(0),
85 m_ignore_mouse_x(-1), m_ignore_mouse_y(-1) {
85 86
86 m_cycling_window = m_focused_list.clientList().end(); 87 m_cycling_window = m_focused_list.clientList().end();
87 88
@@ -400,6 +401,28 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) {
400 401
401} 402}
402 403
404void FocusControl::ignoreAtPointer()
405{
406 int ignore_i;
407 unsigned int ignore_ui;
408 Window ignore_w;
409
410 XQueryPointer(m_screen.rootWindow().display(),
411 m_screen.rootWindow().window(), &ignore_w, &ignore_w,
412 &m_ignore_mouse_x, &m_ignore_mouse_y,
413 &ignore_i, &ignore_i, &ignore_ui);
414}
415
416void FocusControl::ignoreAt(int x, int y)
417{
418 m_ignore_mouse_x = x; m_ignore_mouse_y = y;
419}
420
421bool FocusControl::isIgnored(int x, int y)
422{
423 return x == m_ignore_mouse_x && y == m_ignore_mouse_y;
424}
425
403void FocusControl::removeClient(WinClient &client) { 426void FocusControl::removeClient(WinClient &client) {
404 if (client.screen().isShuttingdown()) 427 if (client.screen().isShuttingdown())
405 return; 428 return;