From 0a7cb3db1f1eaf18eeed8695a7434027bfc7ce6c Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 22 Nov 2007 04:41:36 +0000 Subject: use winclient instead of fluxboxwindow for matching, and removing old code --- src/CurrentWindowCmd.cc | 9 ++++++++- src/CurrentWindowCmd.hh | 1 + src/WorkspaceCmd.cc | 6 ------ src/WorkspaceCmd.hh | 2 -- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index a5265f9..78f3aa1 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc @@ -57,6 +57,13 @@ FluxboxWindow &WindowHelperBoolCmd::fbwindow() { return *FocusControl::focusedFbWindow(); } +WinClient &WindowHelperBoolCmd::winclient() { + // will exist from execute above + WinClient *tmp = WindowCmd::client(); + if (tmp) return *tmp; + return *FocusControl::focusedWindow(); +} + void CurrentWindowCmd::real_execute() { (fbwindow().*m_action)(); } @@ -234,5 +241,5 @@ void SetAlphaCmd::real_execute() { } bool MatchCmd::real_execute() { - return m_pat.match(fbwindow()); + return m_pat.match(winclient()); } diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh index e7370de..c8e6242 100644 --- a/src/CurrentWindowCmd.hh +++ b/src/CurrentWindowCmd.hh @@ -50,6 +50,7 @@ public: protected: FluxboxWindow &fbwindow(); + WinClient &winclient(); virtual bool real_execute() = 0; }; diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 26f113d..af0f3c5 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -64,9 +64,6 @@ void WindowListCmd::execute() { } bool SomeCmd::bool_execute() { - if (m_pat.error()) - return m_cmd->bool_execute(); - BScreen *screen = Fluxbox::instance()->keyScreen(); if (screen != 0) { FocusControl::Focusables win_list(screen->focusControl().creationOrderList().clientList()); @@ -85,9 +82,6 @@ bool SomeCmd::bool_execute() { } bool EveryCmd::bool_execute() { - if (m_pat.error()) - return m_cmd->bool_execute(); - BScreen *screen = Fluxbox::instance()->keyScreen(); if (screen != 0) { FocusControl::Focusables win_list(screen->focusControl().creationOrderList().clientList()); diff --git a/src/WorkspaceCmd.hh b/src/WorkspaceCmd.hh index 4f4545d..eeacc16 100644 --- a/src/WorkspaceCmd.hh +++ b/src/WorkspaceCmd.hh @@ -52,7 +52,6 @@ public: private: FbTk::RefCount m_cmd; - ClientPattern m_pat; }; class EveryCmd: public FbTk::BoolCommand { @@ -63,7 +62,6 @@ public: private: FbTk::RefCount m_cmd; - ClientPattern m_pat; }; class AttachCmd: public FbTk::Command { -- cgit v0.11.2