aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-30 22:36:53 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-30 22:36:53 (GMT)
commit41b2e0ced41580d377ea04a3c1c19408f2d8db13 (patch)
tree276612e9d808863bed0210fa59ce8af24425148d
parentfd0389d2e1c28e7dcd1507f76ed37eb8366c4af0 (diff)
downloadfluxbox-41b2e0ced41580d377ea04a3c1c19408f2d8db13.zip
fluxbox-41b2e0ced41580d377ea04a3c1c19408f2d8db13.tar.bz2
use FbMenu::window instead of WindowCmd<>::window for displaying items in the window menu
-rw-r--r--src/FbMenu.cc13
-rw-r--r--src/FbMenu.hh1
-rw-r--r--src/MenuCreator.cc8
-rw-r--r--src/Remember.cc19
4 files changed, 20 insertions, 21 deletions
diff --git a/src/FbMenu.cc b/src/FbMenu.cc
index 769241d..5bc3622 100644
--- a/src/FbMenu.cc
+++ b/src/FbMenu.cc
@@ -35,14 +35,11 @@ FbMenu::FbMenu(FbTk::ThemeProxy<FbTk::MenuTheme> &tm,
35 35
36} 36}
37 37
38void FbMenu::show() {
39 WindowCmd<void>::setWindow(s_window);
40 FbTk::Menu::show();
41}
42
43void FbMenu::buttonPressEvent(XButtonEvent &be) { 38void FbMenu::buttonPressEvent(XButtonEvent &be) {
39 WinClient *old = WindowCmd<void>::client();
44 WindowCmd<void>::setWindow(s_window); 40 WindowCmd<void>::setWindow(s_window);
45 FbTk::Menu::buttonPressEvent(be); 41 FbTk::Menu::buttonPressEvent(be);
42 WindowCmd<void>::setClient(old);
46} 43}
47 44
48void FbMenu::buttonReleaseEvent(XButtonEvent &be) { 45void FbMenu::buttonReleaseEvent(XButtonEvent &be) {
@@ -55,13 +52,17 @@ void FbMenu::buttonReleaseEvent(XButtonEvent &be) {
55 screen->getHeadWidth(head), 52 screen->getHeadWidth(head),
56 screen->getHeadHeight(head)); 53 screen->getHeadHeight(head));
57 } 54 }
58 WindowCmd<void>::setWindow(s_window);
59 55
60 // now get on with the show 56 // now get on with the show
57 WinClient *old = WindowCmd<void>::client();
58 WindowCmd<void>::setWindow(s_window);
61 FbTk::Menu::buttonReleaseEvent(be); 59 FbTk::Menu::buttonReleaseEvent(be);
60 WindowCmd<void>::setClient(old);
62} 61}
63 62
64void FbMenu::keyPressEvent(XKeyEvent &ke) { 63void FbMenu::keyPressEvent(XKeyEvent &ke) {
64 WinClient *old = WindowCmd<void>::client();
65 WindowCmd<void>::setWindow(s_window); 65 WindowCmd<void>::setWindow(s_window);
66 FbTk::Menu::keyPressEvent(ke); 66 FbTk::Menu::keyPressEvent(ke);
67 WindowCmd<void>::setClient(old);
67} 68}
diff --git a/src/FbMenu.hh b/src/FbMenu.hh
index 11ed3c3..2e709fd 100644
--- a/src/FbMenu.hh
+++ b/src/FbMenu.hh
@@ -42,7 +42,6 @@ public:
42 virtual ~FbMenu() { } 42 virtual ~FbMenu() { }
43 void raise() { m_layeritem.raise(); } 43 void raise() { m_layeritem.raise(); }
44 void lower() { m_layeritem.lower(); } 44 void lower() { m_layeritem.lower(); }
45 void show();
46 void buttonPressEvent(XButtonEvent &be); 45 void buttonPressEvent(XButtonEvent &be);
47 void buttonReleaseEvent(XButtonEvent &be); 46 void buttonReleaseEvent(XButtonEvent &be);
48 void keyPressEvent(XKeyEvent &ke); 47 void keyPressEvent(XKeyEvent &ke);
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index db9aca2..8f9b9a7 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -168,14 +168,14 @@ private:
168class MenuContext: public LayerObject { 168class MenuContext: public LayerObject {
169public: 169public:
170 void moveToLayer(int layer_number) { 170 void moveToLayer(int layer_number) {
171 if (WindowCmd<void>::window() == 0) 171 if (FbMenu::window() == 0)
172 return; 172 return;
173 WindowCmd<void>::window()->moveToLayer(layer_number); 173 FbMenu::window()->moveToLayer(layer_number);
174 } 174 }
175 int layerNumber() const { 175 int layerNumber() const {
176 if (WindowCmd<void>::window() == 0) 176 if (FbMenu::window() == 0)
177 return -1; 177 return -1;
178 return WindowCmd<void>::window()->layerItem().getLayerNum(); 178 return FbMenu::window()->layerItem().getLayerNum();
179 } 179 }
180 180
181}; 181};
diff --git a/src/Remember.cc b/src/Remember.cc
index 0fa778f..6a611bf 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -29,7 +29,6 @@
29#include "FbMenu.hh" 29#include "FbMenu.hh"
30#include "FbCommands.hh" 30#include "FbCommands.hh"
31#include "fluxbox.hh" 31#include "fluxbox.hh"
32#include "WindowCmd.hh"
33#include "Layer.hh" 32#include "Layer.hh"
34 33
35#include "FbTk/I18n.hh" 34#include "FbTk/I18n.hh"
@@ -250,23 +249,23 @@ public:
250 } 249 }
251 250
252 bool isSelected() const { 251 bool isSelected() const {
253 if (WindowCmd<void>::window() == 0) 252 if (FbMenu::window() == 0)
254 return false; 253 return false;
255 254
256 if (WindowCmd<void>::window()->numClients()) // ensure it HAS clients 255 if (FbMenu::window()->numClients()) // ensure it HAS clients
257 return Remember::instance().isRemembered(WindowCmd<void>::window()->winClient(), m_attrib); 256 return Remember::instance().isRemembered(FbMenu::window()->winClient(), m_attrib);
258 else 257 else
259 return false; 258 return false;
260 } 259 }
261 260
262 bool isEnabled() const { 261 bool isEnabled() const {
263 if (WindowCmd<void>::window() == 0) 262 if (FbMenu::window() == 0)
264 return false; 263 return false;
265 264
266 if (m_attrib != Remember::REM_JUMPWORKSPACE) 265 if (m_attrib != Remember::REM_JUMPWORKSPACE)
267 return true; 266 return true;
268 else if (WindowCmd<void>::window()->numClients()) 267 else if (FbMenu::window()->numClients())
269 return (Remember::instance().isRemembered(WindowCmd<void>::window()->winClient(), Remember::REM_WORKSPACE)); 268 return (Remember::instance().isRemembered(FbMenu::window()->winClient(), Remember::REM_WORKSPACE));
270 else 269 else
271 return false; 270 return false;
272 } 271 }
@@ -274,11 +273,11 @@ public:
274 void click(int button, int time, unsigned int mods) { 273 void click(int button, int time, unsigned int mods) {
275 // reconfigure only does stuff if the apps file has changed 274 // reconfigure only does stuff if the apps file has changed
276 Remember::instance().checkReload(); 275 Remember::instance().checkReload();
277 if (WindowCmd<void>::window() != 0) { 276 if (FbMenu::window() != 0) {
278 if (isSelected()) { 277 if (isSelected()) {
279 Remember::instance().forgetAttrib(WindowCmd<void>::window()->winClient(), m_attrib); 278 Remember::instance().forgetAttrib(FbMenu::window()->winClient(), m_attrib);
280 } else { 279 } else {
281 Remember::instance().rememberAttrib(WindowCmd<void>::window()->winClient(), m_attrib); 280 Remember::instance().rememberAttrib(FbMenu::window()->winClient(), m_attrib);
282 } 281 }
283 } 282 }
284 Remember::instance().save(); 283 Remember::instance().save();