hide menus when clicking title or toolbar
BUG: 1149
This commit is contained in:
parent
6c2641404a
commit
36993a80f4
3 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
|
|
|
@ -514,6 +514,9 @@ void Toolbar::reconfigure() {
|
|||
|
||||
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)) {
|
||||
|
|
|
@ -2415,6 +2415,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
|
|||
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 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
|
|||
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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue