From 3c361634dc22358b3e67bd796e3995ee63553628 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 3 Jun 2007 23:51:01 +0000 Subject: update menu xinerama settings after moving --- ChangeLog | 4 ++++ src/FbMenu.cc | 18 +++++++++++++++++- src/FbMenu.hh | 1 + src/FbTk/Menu.hh | 3 ++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a37fe57..f08d9f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ (Format: Year/Month/Day) Changes for 1.1: +*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) 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 @@ #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 @@ void FbMenu::reconfigure() { 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); +} 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: void raise() { m_layeritem.raise(); } void lower() { m_layeritem.lower(); } void reconfigure(); + void buttonReleaseEvent(XButtonEvent &be); private: FbTk::XLayerItem m_layeritem; std::auto_ptr m_shape; diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 7ca4e39..20562de 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh @@ -105,7 +105,7 @@ public: //@{ 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); @@ -139,6 +139,7 @@ public: #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; } -- cgit v0.11.2