all repos — fluxbox @ 5aecf58d47702e6d12ff1174b03a797b516245b7

custom fork of the fluxbox windowmanager

make sure menus close only when right clicking down and up on the titlebar
markt markt
commit

5aecf58d47702e6d12ff1174b03a797b516245b7

parent

857a6d0a6aaafcb453efaa7307194ea1e1387d58

3 files changed, 10 insertions(+), 5 deletions(-)

jump to
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -600,7 +600,7 @@ else

shown = (Menu *) 0; } - m_torn = m_visible = false; + m_torn = m_visible = m_closing = false; m_which_sub = -1; if (first && m_parent && m_parent->isVisible() &&

@@ -835,12 +835,16 @@ // if there's a submenu open, focus it instead

if (validIndex(m_which_sub) && menuitems[m_which_sub]->submenu()->isVisible()) menuitems[m_which_sub]->submenu()->grabInputFocus(); - } + } else if (event.type == LeaveNotify) + m_closing = false; } void Menu::buttonPressEvent(XButtonEvent &be) { - if (be.window == menu.title) + if (be.window == menu.title) { grabInputFocus(); + m_closing = (be.button == 3); + } else + m_closing = false; if (be.window == menu.frame && menu.item_w != 0) {

@@ -879,7 +883,7 @@ clearWindow();

} } - if (re.button == 3) + if (re.button == 3 && m_closing) internal_hide(); } else if (re.window == menu.frame) {
M src/FbTk/Menu.hhsrc/FbTk/Menu.hh

@@ -220,6 +220,7 @@

int m_screen_x, m_screen_y; unsigned int m_screen_width, m_screen_height; bool m_moving; ///< if we're moving/draging or not + bool m_closing; ///< if we're right clicking on the menu title bool m_visible; ///< menu visibility bool m_torn; ///< torn from parent bool m_internal_menu; ///< whether we should destroy this menu or if it's managed somewhere else
M src/Gnome.ccsrc/Gnome.cc

@@ -216,7 +216,7 @@ delete[] wl;

} void Gnome::updateClientClose(WinClient &client) { - if (client.screen().isShuttingdown()) { + if (!client.screen().isShuttingdown()) { XDeleteProperty(FbTk::App::instance()->display(), client.window(), m_gnome_wm_win_workspace); XDeleteProperty(FbTk::App::instance()->display(), client.window(),