all repos — fluxbox @ 2b7f9a5899a1bfc680761ae6792af0eeb99d76f3

custom fork of the fluxbox windowmanager

hidemenus hide custommenus and fix custommenu memleak
markt markt
commit

2b7f9a5899a1bfc680761ae6792af0eeb99d76f3

parent

ff3ea6f5aa685dbf1b285905ccdb6c0a6e9a0e9f

3 files changed, 13 insertions(+), 3 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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:
M src/FbCommands.ccsrc/FbCommands.cc

@@ -269,6 +269,8 @@ if (screen->rootMenu().isVisible())

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() {
M src/FbCommands.hhsrc/FbCommands.hh

@@ -28,6 +28,9 @@ #define FBCOMMANDS_HH

#include "Command.hh" +#include "FbTk/RefCount.hh" +#include "FbTk/Menu.hh" + #include <string> namespace FbCommands {

@@ -124,7 +127,7 @@ explicit ShowCustomMenuCmd(const std::string &arguments);

void execute(); private: std::string custom_menu_file; - + FbTk::RefCount<FbTk::Menu> m_menu; }; class ShowRootMenuCmd: public FbTk::Command {