hide menus when clicking title or toolbar BUG: 1149
Thomas Lübking thomas.luebking@gmail.com
3 files changed,
8 insertions(+),
1 deletions(-)
M
src/IconbarTool.cc
→
src/IconbarTool.cc
@@ -194,6 +194,7 @@ class ShowMenu: public FbTk::Command<void> {
public: explicit ShowMenu(FluxboxWindow &win):m_win(win) { } void execute() { + FbTk::Menu::hideShownMenu(); // get last button pos const XEvent &e = Fluxbox::instance()->lastEvent(); m_win.popupMenu(e.xbutton.x_root, e.xbutton.y_root);@@ -206,6 +207,7 @@ class FocusCommand: public FbTk::Command<void> {
public: explicit FocusCommand(Focusable &win): m_win(win) { } void execute() { + FbTk::Menu::hideShownMenu(); // this needs to be a local variable, as this object could be destroyed // if the workspace is changed. FluxboxWindow *fbwin = m_win.fbwindow();
M
src/Toolbar.cc
→
src/Toolbar.cc
@@ -514,6 +514,9 @@
void Toolbar::buttonPressEvent(XButtonEvent &be) { Display *dpy = Fluxbox::instance()->display(); + + FbTk::Menu::hideShownMenu(); + if (be.subwindow) { // Do not intercept mouse events that are meant for the tray icon if (SystemTray::doesControl(be.subwindow)) {
M
src/Window.cc
→
src/Window.cc
@@ -2415,6 +2415,8 @@ m_last_button_x = be.x_root;
m_last_button_y = be.y_root; m_last_pressed_button = be.button; + FbTk::Menu::hideShownMenu(); + Keys *k = Fluxbox::instance()->keys(); int context = 0; context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);@@ -2448,7 +2450,7 @@
m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth(); m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth(); } - FbTk::Menu::hideShownMenu(); + if (!m_focused && acceptsFocus() && m_click_focus) focus();