From 443e7081d44f27a254fbbb549013ef337f078b13 Mon Sep 17 00:00:00 2001 From: mathias Date: Wed, 24 Nov 2004 12:26:12 +0000 Subject: fix the hiding of the menu when the menufile-timestamps changed --- src/FbCommands.cc | 18 ++++++++++++++---- src/fluxbox.cc | 12 ++++++++++-- src/fluxbox.hh | 3 ++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 84ad456..fbe41bd 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -58,6 +58,19 @@ using namespace std; namespace { void showMenu(const BScreen &screen, FbTk::Menu &menu) { + + // special case for root menu + if (&menu == &screen.getRootmenu()) { + Fluxbox* fb = Fluxbox::instance(); + if(fb->menuTimestampsChanged()) { + // we dont show the menu here because fluxbox + // will bring up the rootmenu after the timed + // reread of the menu + fb->rereadMenu(true); + return; + } + } + Window root_ret; // not used Window window_ret; // not used @@ -84,10 +97,7 @@ void showMenu(const BScreen &screen, FbTk::Menu &menu) { screen.getHeadY(head), screen.getHeadWidth(head), screen.getHeadHeight(head)); - // special case for root menu - if (&menu == &screen.getRootmenu()) - Fluxbox::instance()->checkMenu(); - + menu.show(); menu.grabInputFocus(); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 57a7dd1..b5e7828 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -1624,7 +1624,6 @@ void Fluxbox::real_reconfigure() { //reconfigure keys m_key->reconfigure(StringUtil::expandFilename(*m_rc_keyfile).c_str()); - } BScreen *Fluxbox::findScreen(int id) { @@ -1676,8 +1675,9 @@ void Fluxbox::hideExtraMenus(BScreen &screen) { } -void Fluxbox::rereadMenu() { +void Fluxbox::rereadMenu(bool show_after_reread) { m_reread_menu_wait = true; + m_show_menu_after_reread = show_after_reread; m_reconfig_timer.start(); } @@ -1690,6 +1690,14 @@ void Fluxbox::real_rereadMenu() { m_menu_timestamps.erase(m_menu_timestamps.begin(), m_menu_timestamps.end()); for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::rereadMenu)); + + if(m_show_menu_after_reread) { + + FbCommands::ShowRootMenuCmd showcmd; + showcmd.execute(); + + m_show_menu_after_reread = false; + } } void Fluxbox::saveMenuFilename(const char *filename) { diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 6ed7902..e850994 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -189,7 +189,7 @@ public: void removeGroupSearch(Window win); void restart(const char *command = 0); void reconfigure(); - void rereadMenu(); + void rereadMenu(bool show_after_reread = false); /// reloads the menus if the timestamps changed void checkMenu(); @@ -325,6 +325,7 @@ private: bool m_starting; bool m_restarting; bool m_shutdown; + bool m_show_menu_after_reread; int m_server_grabs; int m_randr_event_type; ///< the type number of randr event int m_shape_eventbase; ///< event base for shape events -- cgit v0.11.2