update menu xinerama settings after moving
markt markt
4 files changed,
24 insertions(+),
2 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,9 @@
(Format: Year/Month/Day) Changes for 1.0.0: +*07/06/04: + * Fix submenu placement with xinerama after moving the menu between heads, + bug #1479517 (Mark) + FbMenu.cc/hh FbTk/Menu.hh *07/06/03: * Deiconify when automatically tabbing to a minimized window with focus new windows on, bug #1716899 (Mark)
M
src/FbMenu.cc
→
src/FbMenu.cc
@@ -23,8 +23,10 @@ // $Id$
#include "FbMenu.hh" -#include "MenuTheme.hh" +#include "fluxbox.hh" +#include "MenuTheme.hh" +#include "Screen.hh" #include "Shape.hh" FbMenu::FbMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl,@@ -54,3 +56,17 @@ m_shape->setPlaces(dynamic_cast<const MenuTheme&>(theme()).shapePlaces());
FbTk::Menu::reconfigure(); } +void FbMenu::buttonReleaseEvent(XButtonEvent &be) { + BScreen *screen = Fluxbox::instance()->findScreen(screenNumber()); + if (be.window == titleWindow() && isMoving() && screen) { + // menu stopped moving, so update head + int head = screen->getHead(be.x_root, be.y_root); + setScreen(screen->getHeadX(head), + screen->getHeadY(head), + screen->getHeadWidth(head), + screen->getHeadHeight(head)); + } + + // now get on with the show + FbTk::Menu::buttonReleaseEvent(be); +}
M
src/FbMenu.hh
→
src/FbMenu.hh
@@ -41,6 +41,7 @@ void clearWindow();
void raise() { m_layeritem.raise(); } void lower() { m_layeritem.lower(); } void reconfigure(); + void buttonReleaseEvent(XButtonEvent &be); private: FbTk::XLayerItem m_layeritem; std::auto_ptr<Shape> m_shape;
M
src/FbTk/Menu.hh
→
src/FbTk/Menu.hh
@@ -104,7 +104,7 @@ */
//@{ void handleEvent(XEvent &event); void buttonPressEvent(XButtonEvent &bp); - void buttonReleaseEvent(XButtonEvent &br); + virtual void buttonReleaseEvent(XButtonEvent &br); void motionNotifyEvent(XMotionEvent &mn); void exposeEvent(XExposeEvent &ee); void keyPressEvent(XKeyEvent &ke);@@ -138,6 +138,7 @@ inline int activeIndex() const { return m_active_index; }
#endif inline bool isTorn() const { return m_torn; } inline bool isVisible() const { return m_visible; } + inline bool isMoving() const { return m_moving; } inline int screenNumber() const { return menu.window.screenNumber(); } inline Window window() const { return menu.window.window(); } inline FbWindow &fbwindow() { return menu.window; }