From 8311058a16b79294e8b4994c21e3cc63b9956f9d Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Mon, 30 Apr 2012 14:36:43 -0300 Subject: [PATCH] Revert "Inotify: Reload keyboard shortcut definitions when configuration changes" This reverts commit cbe2f4e61a12b6bb13469f1eac7df14bbf423128. The reason for the revert is the regression reported here: http://marc.info/?l=openbsd-ports&m=133151145814675&w=2 I've been able to reliably reproduce the double-spawning of xterms I've been seeing. The bad news is that it still happens even with a fresh configuration directory. To reproduce: 0) Create a keyboard shortcut if one does not already exist (I'm using +u set to spawn an xterm) 1) Open WindowMaker's preferences. 2) Click on "Applications Menu Definition" (it's the icon immediately to the left of the keyboard icon) 3) Click save, and then close. 4) Keyboard shortcuts will spawn two applications. I use keyboard shortcuts to spawn xterms, browsers, and filemanagers. All of them spawn twice after performing the above. To fix it, or -> Exit -> Restart. If I repeat steps 1-3, three windows will spawn. Repeat again and four windows will spawn etc. (I stopped after getting five to spawn at once). --- src/defaults.c | 4 ---- src/rootmenu.c | 8 ++++---- src/rootmenu.h | 7 ++----- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/defaults.c b/src/defaults.c index 69832751..1f6b6eb6 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -61,7 +61,6 @@ #include "dock.h" #include "workspace.h" #include "properties.h" -#include "rootmenu.h" #define MAX_SHORTCUT_LENGTH 32 @@ -1013,9 +1012,6 @@ void wDefaultsCheckDomains(void* arg) } WDRootMenu->dictionary = dict; wDefaultsMergeGlobalMenus(WDRootMenu); - scr = wScreenWithNumber(0); - configureMenu(scr, dict, True); - rebind_key_grabs(scr); } } else { wwarning(_("could not load domain %s from user defaults database"), "WMRootMenu"); diff --git a/src/rootmenu.c b/src/rootmenu.c index b2b28cec..cca29aeb 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -50,7 +50,6 @@ #include "framewin.h" #include "session.h" #include "xmodifier.h" -#include "rootmenu.h" #include @@ -64,6 +63,7 @@ extern WPreferences wPreferences; static WMenu *readMenuPipe(WScreen * scr, char **file_name); static WMenu *readMenuFile(WScreen * scr, char *file_name); static WMenu *readMenuDirectory(WScreen * scr, char *title, char **file_name, char *command); +static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals); typedef struct Shortcut { struct Shortcut *next; @@ -377,7 +377,7 @@ void wRootMenuBindShortcuts(Window window) } } -void rebind_key_grabs(WScreen *scr) +static void rebindKeygrabs(WScreen * scr) { WWindow *wwin; @@ -1477,7 +1477,7 @@ static WMenu *makeDefaultMenu(WScreen * scr) * *---------------------------------------------------------------------- */ -WMenu *configureMenu(WScreen *scr, WMPropList *definition, Bool includeGlobals) +static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals) { WMenu *menu = NULL; WMPropList *elem; @@ -1728,5 +1728,5 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard) } if (scr->flags.root_menu_changed_shortcuts) - rebind_key_grabs(scr); + rebindKeygrabs(scr); } diff --git a/src/rootmenu.h b/src/rootmenu.h index 76085368..e7ed8557 100644 --- a/src/rootmenu.h +++ b/src/rootmenu.h @@ -23,11 +23,11 @@ #define WMROOTMENU_H #include "WindowMaker.h" -#include "screen.h" -#include "menu.h" + typedef void *WRootMenuData; + typedef struct _WRootMenuReader { Bool (*checkMenuChange)(char *path, time_t lastAccessTime); @@ -41,7 +41,4 @@ typedef struct _WRootMenuReader { void (*closeMenuFile)(WRootMenuData *data); } WRootMenuReader; -void rebind_key_grabs(WScreen *scr); -WMenu *configureMenu(WScreen *scr, WMPropList *definition, Bool includeGlobals); - #endif /* WMROOTMENU_H */ -- 2.11.4.GIT