summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-03-10 18:08:37 (GMT)
committermarkt <markt>2007-03-10 18:08:37 (GMT)
commit8bda89394b5bcbca5781f1e60bd786c17c1bee49 (patch)
tree7993e208ec1d128d37fc8956b270e33f744cf675 /src
parent61cf82771af9d39703ad0ebfdc9299fe5ffe525d (diff)
downloadfluxbox_lack-8bda89394b5bcbca5781f1e60bd786c17c1bee49.zip
fluxbox_lack-8bda89394b5bcbca5781f1e60bd786c17c1bee49.tar.bz2
make sure we don't steal focus from unmanaged windows
Diffstat (limited to 'src')
-rw-r--r--src/fluxbox.cc16
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
1721void Fluxbox::revert_focus() { 1721void 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