diff options
author | markt <markt> | 2007-03-10 18:08:37 (GMT) |
---|---|---|
committer | markt <markt> | 2007-03-10 18:08:37 (GMT) |
commit | 8bda89394b5bcbca5781f1e60bd786c17c1bee49 (patch) | |
tree | 7993e208ec1d128d37fc8956b270e33f744cf675 | |
parent | 61cf82771af9d39703ad0ebfdc9299fe5ffe525d (diff) | |
download | fluxbox_pavel-8bda89394b5bcbca5781f1e60bd786c17c1bee49.zip fluxbox_pavel-8bda89394b5bcbca5781f1e60bd786c17c1bee49.tar.bz2 |
make sure we don't steal focus from unmanaged windows
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/fluxbox.cc | 16 |
2 files changed, 17 insertions, 2 deletions
@@ -1,5 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.0rc3: | 2 | Changes for 1.0rc3: |
3 | *07/03/10: | ||
4 | * Fixed stealing focus from unmanaged windows (Mark) | ||
5 | fluxbox.cc | ||
3 | *07/03/07: | 6 | *07/03/07: |
4 | * Fixed a little bug with reverting focus after closing menu (Mark) | 7 | * Fixed a little bug with reverting focus after closing menu (Mark) |
5 | FbTk/Menu.cc | 8 | FbTk/Menu.cc |
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 | ||