From 2b7f9a5899a1bfc680761ae6792af0eeb99d76f3 Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 21 Mar 2007 22:47:56 +0000 Subject: hidemenus hide custommenus and fix custommenu memleak --- ChangeLog | 4 ++++ src/FbCommands.cc | 7 +++++-- src/FbCommands.hh | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96126ba..0a8fb21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ (Format: Year/Month/Day) Changes for 1.0rc3: +*07/03/21: + * HideMenus didn't work on CustomMenus, and also fixed a memleak with + CustomMenu (Mark + thanks Julien Trolet) + FbCommands.cc/hh *07/03/20: * Updated doc/asciidoc/fluxbox.txt (Mathias) *07/03/19: diff --git a/src/FbCommands.cc b/src/FbCommands.cc index d53afd2..20d45e0 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -269,6 +269,8 @@ void HideMenuCmd::execute() { screen->rootMenu().hide(); if (screen->workspaceMenu().isVisible()) screen->workspaceMenu().hide(); + if (FbTk::Menu::shownMenu()) + FbTk::Menu::shownMenu()->hide(); } ShowCustomMenuCmd::ShowCustomMenuCmd(const string &arguments) : custom_menu_file(arguments) {} @@ -277,8 +279,9 @@ void ShowCustomMenuCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen == 0) return; - ::showMenu(*screen, *MenuCreator::createFromFile(custom_menu_file, - screen->screenNumber(), true)); + m_menu = MenuCreator::createFromFile(custom_menu_file, + screen->screenNumber(), true); + ::showMenu(*screen, **m_menu); } void ShowRootMenuCmd::execute() { diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 3bc5074..314d339 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh @@ -28,6 +28,9 @@ #include "Command.hh" +#include "FbTk/RefCount.hh" +#include "FbTk/Menu.hh" + #include namespace FbCommands { @@ -124,7 +127,7 @@ public: void execute(); private: std::string custom_menu_file; - + FbTk::RefCount m_menu; }; class ShowRootMenuCmd: public FbTk::Command { -- cgit v0.11.2