make sure window commands operate on the right window
markt markt
2 files changed,
12 insertions(+),
0 deletions(-)
M
src/Toolbar.cc
→
src/Toolbar.cc
@@ -35,6 +35,7 @@
#include "fluxbox.hh" #include "Keys.hh" #include "Screen.hh" +#include "WindowCmd.hh" #include "IntResMenuItem.hh" #include "BoolMenuItem.hh"@@ -524,6 +525,7 @@
void Toolbar::buttonPressEvent(XButtonEvent &be) { + WindowCmd<void>::setWindow(0); if (Fluxbox::instance()->keys()->doAction(be.type, be.state, be.button, Keys::ON_TOOLBAR)) return;@@ -557,6 +559,7 @@
} void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { + WindowCmd<void>::setWindow(0); Fluxbox::instance()->keys()->doAction(ce.type, ce.state, 0, Keys::ON_TOOLBAR); if (! doAutoHide()) {
M
src/WorkspaceCmd.cc
→
src/WorkspaceCmd.cc
@@ -54,12 +54,15 @@ FocusControl::Focusables win_list(screen->focusControl().creationOrderWinList().clientList());
FocusControl::Focusables::iterator it = win_list.begin(), it_end = win_list.end(); + // save old value, so we can restore it later + WinClient *old = WindowCmd<void>::client(); for (; it != it_end; ++it) { if (m_pat.match(**it) && (*it)->fbwindow()) { WindowCmd<void>::setWindow((*it)->fbwindow()); m_cmd->execute(); } } + WindowCmd<void>::setClient(old); } }@@ -70,6 +73,8 @@ FocusControl::Focusables win_list(screen->focusControl().creationOrderList().clientList());
FocusControl::Focusables::iterator it = win_list.begin(), it_end = win_list.end(); + // save old value, so we can restore it later + WinClient *old = WindowCmd<void>::client(); for (; it != it_end; ++it) { WinClient *client = dynamic_cast<WinClient *>(*it); if (!client) continue;@@ -77,6 +82,7 @@ WindowCmd<void>::setClient(client);
if (m_cmd->bool_execute()) return true; } + WindowCmd<void>::setClient(old); } return false; }@@ -88,6 +94,8 @@ FocusControl::Focusables win_list(screen->focusControl().creationOrderList().clientList());
FocusControl::Focusables::iterator it = win_list.begin(), it_end = win_list.end(); + // save old value, so we can restore it later + WinClient *old = WindowCmd<void>::client(); for (; it != it_end; ++it) { WinClient *client = dynamic_cast<WinClient *>(*it); if (!client) continue;@@ -95,6 +103,7 @@ WindowCmd<void>::setClient(client);
if (!m_cmd->bool_execute()) return false; } + WindowCmd<void>::setClient(old); } return true; }