diff options
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r-- | src/FbCommands.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 91490d3..4eabae2 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc | |||
@@ -76,13 +76,8 @@ void showMenu(const BScreen &screen, FbTk::Menu &menu) { | |||
76 | // special case for root menu | 76 | // special case for root menu |
77 | if (&menu == &screen.rootMenu()) { | 77 | if (&menu == &screen.rootMenu()) { |
78 | Fluxbox* fb = Fluxbox::instance(); | 78 | Fluxbox* fb = Fluxbox::instance(); |
79 | if(fb->menuTimestampsChanged()) { | 79 | if(fb->menuTimestampsChanged()) |
80 | // we dont show the menu here because fluxbox | ||
81 | // will bring up the rootmenu after the timed | ||
82 | // reread of the menu | ||
83 | fb->rereadMenu(); | 80 | fb->rereadMenu(); |
84 | return; | ||
85 | } | ||
86 | } | 81 | } |
87 | 82 | ||
88 | Window root_ret; // not used | 83 | Window root_ret; // not used |
@@ -335,8 +330,8 @@ void ShowClientMenuCmd::execute() { | |||
335 | m_list.push_back(static_cast<FluxboxWindow *>(*it)); | 330 | m_list.push_back(static_cast<FluxboxWindow *>(*it)); |
336 | } | 331 | } |
337 | 332 | ||
338 | m_menu = new ClientMenu(*screen, m_list, 0); | 333 | m_menu.reset(new ClientMenu(*screen, m_list, 0)); |
339 | ::showMenu(*screen, **m_menu); | 334 | ::showMenu(*screen, *m_menu.get()); |
340 | } | 335 | } |
341 | 336 | ||
342 | REGISTER_COMMAND_WITH_ARGS(custommenu, FbCommands::ShowCustomMenuCmd, void); | 337 | REGISTER_COMMAND_WITH_ARGS(custommenu, FbCommands::ShowCustomMenuCmd, void); |
@@ -347,11 +342,15 @@ void ShowCustomMenuCmd::execute() { | |||
347 | BScreen *screen = Fluxbox::instance()->mouseScreen(); | 342 | BScreen *screen = Fluxbox::instance()->mouseScreen(); |
348 | if (screen == 0) | 343 | if (screen == 0) |
349 | return; | 344 | return; |
350 | m_menu = MenuCreator::createFromFile(custom_menu_file, | 345 | |
351 | screen->screenNumber()); | 346 | if (m_menu.get()) { |
352 | if (!m_menu.get()) | 347 | m_menu->removeAll(); |
353 | return; | 348 | m_menu->setLabel(""); |
354 | ::showMenu(*screen, **m_menu); | 349 | } else |
350 | m_menu.reset(screen->createMenu("")); | ||
351 | |||
352 | MenuCreator::createFromFile(custom_menu_file, *m_menu.get()); | ||
353 | ::showMenu(*screen, *m_menu.get()); | ||
355 | } | 354 | } |
356 | 355 | ||
357 | REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); | 356 | REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); |