aboutsummaryrefslogtreecommitdiff
path: root/src/WindowCmd.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/WindowCmd.hh')
-rw-r--r--src/WindowCmd.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/WindowCmd.hh b/src/WindowCmd.hh
index 5eca723..17a4e86 100644
--- a/src/WindowCmd.hh
+++ b/src/WindowCmd.hh
@@ -26,14 +26,27 @@
26 26
27#include "FbTk/Command.hh" 27#include "FbTk/Command.hh"
28#include "Window.hh" 28#include "Window.hh"
29#include "WinClient.hh"
29 30
30/// holds context for WindowCmd 31/// holds context for WindowCmd
31class WindowCmd_base { 32class WindowCmd_base {
32public: 33public:
33 static void setWindow(FluxboxWindow *win) { s_win = win; } 34 // some window commands (e.g. close, kill, detach) need to know which client
35 // the command refers to, so we store it here as well, in case it is not the
36 // current client (selected from workspace menu, for example)
37 static void setWindow(FluxboxWindow *win) {
38 s_win = win;
39 s_client = (win ? &win->winClient() : 0);
40 }
41 static void setClient(WinClient *client) {
42 s_client = client;
43 s_win = (client ? client->fbwindow() : 0);
44 }
34 static FluxboxWindow *window() { return s_win; } 45 static FluxboxWindow *window() { return s_win; }
46 static WinClient *client() { return s_client; }
35protected: 47protected:
36 static FluxboxWindow *s_win; 48 static FluxboxWindow *s_win;
49 static WinClient *s_client;
37}; 50};
38 51
39 52