diff options
author | markt <markt> | 2007-07-15 16:33:32 (GMT) |
---|---|---|
committer | markt <markt> | 2007-07-15 16:33:32 (GMT) |
commit | 9c843719a37eb3f63276f338bbc7cc227dc4e439 (patch) | |
tree | 95b779b3e789e90a1be1ff0d7cc95acf82044269 | |
parent | 595e3011704ceccbb5f22886f46ab7d05968e07b (diff) | |
download | fluxbox-9c843719a37eb3f63276f338bbc7cc227dc4e439.zip fluxbox-9c843719a37eb3f63276f338bbc7cc227dc4e439.tar.bz2 |
only close menus when right clicking down and up on titlebar
-rw-r--r-- | src/FbTk/Menu.cc | 12 | ||||
-rw-r--r-- | src/FbTk/Menu.hh | 1 | ||||
-rw-r--r-- | src/Gnome.cc | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 8f795ac..0559f0d 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -596,7 +596,7 @@ void Menu::internal_hide(bool first) { | |||
596 | shown = (Menu *) 0; | 596 | shown = (Menu *) 0; |
597 | } | 597 | } |
598 | 598 | ||
599 | m_torn = m_visible = false; | 599 | m_torn = m_visible = m_closing = false; |
600 | m_which_sub = -1; | 600 | m_which_sub = -1; |
601 | 601 | ||
602 | if (first && m_parent && m_parent->isVisible() && | 602 | if (first && m_parent && m_parent->isVisible() && |
@@ -831,12 +831,16 @@ void Menu::handleEvent(XEvent &event) { | |||
831 | if (validIndex(m_which_sub) && | 831 | if (validIndex(m_which_sub) && |
832 | menuitems[m_which_sub]->submenu()->isVisible()) | 832 | menuitems[m_which_sub]->submenu()->isVisible()) |
833 | menuitems[m_which_sub]->submenu()->grabInputFocus(); | 833 | menuitems[m_which_sub]->submenu()->grabInputFocus(); |
834 | } | 834 | } else if (event.type == LeaveNotify) |
835 | m_closing = false; | ||
835 | } | 836 | } |
836 | 837 | ||
837 | void Menu::buttonPressEvent(XButtonEvent &be) { | 838 | void Menu::buttonPressEvent(XButtonEvent &be) { |
838 | if (be.window == menu.title) | 839 | if (be.window == menu.title) { |
839 | grabInputFocus(); | 840 | grabInputFocus(); |
841 | m_closing = (be.button == 3); | ||
842 | } else | ||
843 | m_closing = false; | ||
840 | 844 | ||
841 | if (be.window == menu.frame && menu.item_w != 0) { | 845 | if (be.window == menu.frame && menu.item_w != 0) { |
842 | 846 | ||
@@ -875,7 +879,7 @@ void Menu::buttonReleaseEvent(XButtonEvent &re) { | |||
875 | } | 879 | } |
876 | } | 880 | } |
877 | 881 | ||
878 | if (re.button == 3) | 882 | if (re.button == 3 && m_closing) |
879 | internal_hide(); | 883 | internal_hide(); |
880 | 884 | ||
881 | } else if (re.window == menu.frame) { | 885 | } else if (re.window == menu.frame) { |
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 8d112ca..06af08d 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -220,6 +220,7 @@ private: | |||
220 | int m_screen_x, m_screen_y; | 220 | int m_screen_x, m_screen_y; |
221 | unsigned int m_screen_width, m_screen_height; | 221 | unsigned int m_screen_width, m_screen_height; |
222 | bool m_moving; ///< if we're moving/draging or not | 222 | bool m_moving; ///< if we're moving/draging or not |
223 | bool m_closing; ///< if we're right clicking on the menu title | ||
223 | bool m_visible; ///< menu visibility | 224 | bool m_visible; ///< menu visibility |
224 | bool m_torn; ///< torn from parent | 225 | bool m_torn; ///< torn from parent |
225 | bool m_internal_menu; ///< whether we should destroy this menu or if it's managed somewhere else | 226 | bool m_internal_menu; ///< whether we should destroy this menu or if it's managed somewhere else |
diff --git a/src/Gnome.cc b/src/Gnome.cc index 94ff9e7..5bdb986 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc | |||
@@ -216,7 +216,7 @@ void Gnome::updateClientList(BScreen &screen) { | |||
216 | } | 216 | } |
217 | 217 | ||
218 | void Gnome::updateClientClose(WinClient &client) { | 218 | void Gnome::updateClientClose(WinClient &client) { |
219 | if (client.screen().isShuttingdown()) { | 219 | if (!client.screen().isShuttingdown()) { |
220 | XDeleteProperty(FbTk::App::instance()->display(), client.window(), | 220 | XDeleteProperty(FbTk::App::instance()->display(), client.window(), |
221 | m_gnome_wm_win_workspace); | 221 | m_gnome_wm_win_workspace); |
222 | XDeleteProperty(FbTk::App::instance()->display(), client.window(), | 222 | XDeleteProperty(FbTk::App::instance()->display(), client.window(), |