all repos — fluxbox @ 5ecebae4770cbe7e4feea46d2c074a818f1c9662

custom fork of the fluxbox windowmanager

Fixed startup bug for window menu in iconbar.

The window menu in the iconbutton was not updated properly
the first time it was used ( before right clicking in the real
window titlebar).
Henrik Kinnunen fluxgen@fluxbox.org
commit

5ecebae4770cbe7e4feea46d2c074a818f1c9662

parent

c31638038aabd93c74373c7ee00fbefbc68d28ae

3 files changed, 21 insertions(+), 14 deletions(-)

jump to
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -214,16 +214,11 @@ class ShowMenu: public FbTk::Command<void> {

public: explicit ShowMenu(FluxboxWindow &win):m_win(win) { } void execute() { - // hide the menu if it's already showing for this FluxboxWindow - if (m_win.menu().isVisible() && FbMenu::window() == &m_win) { - m_win.menu().hide(); - return; - } // get last button pos const XEvent &event = Fluxbox::instance()->lastEvent(); int x = event.xbutton.x_root - (m_win.menu().width() / 2); int y = event.xbutton.y_root - (m_win.menu().height() / 2); - m_win.showMenu(x, y); + m_win.popupMenu(x, y); } private: FluxboxWindow &m_win;
M src/Window.ccsrc/Window.cc

@@ -2172,25 +2172,31 @@ menu().raise();

menu().grabInputFocus(); } +void FluxboxWindow::popupMenu(int x, int y) { + // hide menu if it was opened for this window before + if (menu().isVisible() && FbMenu::window() == this) { + menu().hide(); + return; + } + + menu().disableTitle(); + + showMenu(x, y); +} + /** Moves the menu to last button press position and shows it, if it's already visible it'll be hidden */ void FluxboxWindow::popupMenu() { - // hide menu if it was opened for this window before - if (menu().isVisible() && FbMenu::window() == this) { - menu().hide(); - return; - } - - menu().disableTitle(); int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth(); if (!decorations.titlebar) // if we don't have any titlebar menu_y = 0; if (m_last_button_x < x() || m_last_button_x > x() + static_cast<signed>(width())) m_last_button_x = x(); - showMenu(m_last_button_x, menu_y + frame().y()); + + popupMenu(m_last_button_x, menu_y + frame().y()); }
M src/Window.hhsrc/Window.hh

@@ -323,6 +323,12 @@ * @param mx position

* @param my position */ void showMenu(int mx, int my); + + /** popup window menu at specific location + * @param x + * @param y + */ + void popupMenu(int x, int y); // popup menu on last button press position void popupMenu();