diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index e4c68bf..2393837 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -1719,8 +1719,20 @@ void Fluxbox::timed_reconfigure() { | |||
1719 | } | 1719 | } |
1720 | 1720 | ||
1721 | void Fluxbox::revert_focus() { | 1721 | void Fluxbox::revert_focus() { |
1722 | if (m_revert_screen && !FocusControl::focusedWindow() && | 1722 | if (!m_revert_screen || FocusControl::focusedWindow() || |
1723 | !FbTk::Menu::focused() && !m_showing_dialog) | 1723 | FbTk::Menu::focused() || m_showing_dialog) |
1724 | return; | ||
1725 | |||
1726 | Window win; | ||
1727 | int revert; | ||
1728 | Display *disp = display(); | ||
1729 | |||
1730 | XGetInputFocus(disp, &win, &revert); | ||
1731 | |||
1732 | // we only want to revert focus if it's left dangling, as some other | ||
1733 | // application may have set the focus to an unmanaged window | ||
1734 | if (win == None || win == PointerRoot || | ||
1735 | win == m_revert_screen->rootWindow().window()) | ||
1724 | FocusControl::revertFocus(*m_revert_screen); | 1736 | FocusControl::revertFocus(*m_revert_screen); |
1725 | } | 1737 | } |
1726 | 1738 | ||