aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index 929be5d..a5265f9 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -33,20 +33,25 @@
33#include "FocusControl.hh" 33#include "FocusControl.hh"
34 34
35void WindowHelperCmd::execute() { 35void WindowHelperCmd::execute() {
36 m_win = 0;
37 if (WindowCmd<void>::window() || FocusControl::focusedFbWindow()) 36 if (WindowCmd<void>::window() || FocusControl::focusedFbWindow())
38 real_execute(); 37 real_execute();
39} 38}
40 39
41void WindowHelperCmd::execute(FluxboxWindow &win) { 40FluxboxWindow &WindowHelperCmd::fbwindow() {
42 m_win = &win; 41 // will exist from execute above
43 real_execute(); 42 FluxboxWindow *tmp = WindowCmd<void>::window();
43 if (tmp) return *tmp;
44 return *FocusControl::focusedFbWindow();
44} 45}
45 46
46FluxboxWindow &WindowHelperCmd::fbwindow() { 47bool WindowHelperBoolCmd::bool_execute() {
48 if (WindowCmd<void>::window() || FocusControl::focusedFbWindow())
49 return real_execute();
50 return false;
51}
52
53FluxboxWindow &WindowHelperBoolCmd::fbwindow() {
47 // will exist from execute above 54 // will exist from execute above
48 if (m_win)
49 return *m_win;
50 FluxboxWindow *tmp = WindowCmd<void>::window(); 55 FluxboxWindow *tmp = WindowCmd<void>::window();
51 if (tmp) return *tmp; 56 if (tmp) return *tmp;
52 return *FocusControl::focusedFbWindow(); 57 return *FocusControl::focusedFbWindow();
@@ -227,3 +232,7 @@ void SetAlphaCmd::real_execute() {
227 } else 232 } else
228 fbwindow().setUnfocusedAlpha(m_unfocus); 233 fbwindow().setUnfocusedAlpha(m_unfocus);
229} 234}
235
236bool MatchCmd::real_execute() {
237 return m_pat.match(fbwindow());
238}