summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbMenu.cc18
-rw-r--r--src/FbMenu.hh1
-rw-r--r--src/FbTk/Menu.hh3
3 files changed, 20 insertions, 2 deletions
diff --git a/src/FbMenu.cc b/src/FbMenu.cc
index bcef502..040a881 100644
--- a/src/FbMenu.cc
+++ b/src/FbMenu.cc
@@ -23,8 +23,10 @@
23 23
24 24
25#include "FbMenu.hh" 25#include "FbMenu.hh"
26#include "MenuTheme.hh"
27 26
27#include "fluxbox.hh"
28#include "MenuTheme.hh"
29#include "Screen.hh"
28#include "Shape.hh" 30#include "Shape.hh"
29 31
30FbMenu::FbMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, 32FbMenu::FbMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl,
@@ -54,3 +56,17 @@ void FbMenu::reconfigure() {
54 FbTk::Menu::reconfigure(); 56 FbTk::Menu::reconfigure();
55} 57}
56 58
59void FbMenu::buttonReleaseEvent(XButtonEvent &be) {
60 BScreen *screen = Fluxbox::instance()->findScreen(screenNumber());
61 if (be.window == titleWindow() && isMoving() && screen) {
62 // menu stopped moving, so update head
63 int head = screen->getHead(be.x_root, be.y_root);
64 setScreen(screen->getHeadX(head),
65 screen->getHeadY(head),
66 screen->getHeadWidth(head),
67 screen->getHeadHeight(head));
68 }
69
70 // now get on with the show
71 FbTk::Menu::buttonReleaseEvent(be);
72}
diff --git a/src/FbMenu.hh b/src/FbMenu.hh
index cfd49d1..53266bf 100644
--- a/src/FbMenu.hh
+++ b/src/FbMenu.hh
@@ -41,6 +41,7 @@ public:
41 void raise() { m_layeritem.raise(); } 41 void raise() { m_layeritem.raise(); }
42 void lower() { m_layeritem.lower(); } 42 void lower() { m_layeritem.lower(); }
43 void reconfigure(); 43 void reconfigure();
44 void buttonReleaseEvent(XButtonEvent &be);
44private: 45private:
45 FbTk::XLayerItem m_layeritem; 46 FbTk::XLayerItem m_layeritem;
46 std::auto_ptr<Shape> m_shape; 47 std::auto_ptr<Shape> m_shape;
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index c77b0c0..e6c249d 100644
--- a/src/FbTk/Menu.hh
+++ b/src/FbTk/Menu.hh
@@ -104,7 +104,7 @@ public:
104 //@{ 104 //@{
105 void handleEvent(XEvent &event); 105 void handleEvent(XEvent &event);
106 void buttonPressEvent(XButtonEvent &bp); 106 void buttonPressEvent(XButtonEvent &bp);
107 void buttonReleaseEvent(XButtonEvent &br); 107 virtual void buttonReleaseEvent(XButtonEvent &br);
108 void motionNotifyEvent(XMotionEvent &mn); 108 void motionNotifyEvent(XMotionEvent &mn);
109 void exposeEvent(XExposeEvent &ee); 109 void exposeEvent(XExposeEvent &ee);
110 void keyPressEvent(XKeyEvent &ke); 110 void keyPressEvent(XKeyEvent &ke);
@@ -138,6 +138,7 @@ public:
138#endif 138#endif
139 inline bool isTorn() const { return m_torn; } 139 inline bool isTorn() const { return m_torn; }
140 inline bool isVisible() const { return m_visible; } 140 inline bool isVisible() const { return m_visible; }
141 inline bool isMoving() const { return m_moving; }
141 inline int screenNumber() const { return menu.window.screenNumber(); } 142 inline int screenNumber() const { return menu.window.screenNumber(); }
142 inline Window window() const { return menu.window.window(); } 143 inline Window window() const { return menu.window.window(); }
143 inline FbWindow &fbwindow() { return menu.window; } 144 inline FbWindow &fbwindow() { return menu.window; }