mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Inotify: Reload keyboard shortcut definitions when configuration changes
Despite having the inotify mechanism compiled in my WM, everytime I changed a keyboard shortcut definition in the WMRootMenu via WPrefs I was required to open the WMRootMenu (eg with the F12 key) for the change to take effect...annoying. So explicitly reload the key bindings when a modification inside ~/GNUstep/Defaults/ is detected. As the inotify mechanism calls the function wDefaultsCheckDomains() when that happens, let's add a call to rebind_key_grabs() in there. Now it works fine and changes are automatically in effect once WPrefs writes the menu. PS: rebindKeygrabs() renamed to rebind_key_grabs()...
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include "framewin.h"
|
||||
#include "session.h"
|
||||
#include "xmodifier.h"
|
||||
#include "rootmenu.h"
|
||||
|
||||
#include <WINGs/WUtil.h>
|
||||
|
||||
@@ -63,7 +64,6 @@ 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;
|
||||
@@ -379,7 +379,7 @@ void wRootMenuBindShortcuts(Window window)
|
||||
}
|
||||
}
|
||||
|
||||
static void rebindKeygrabs(WScreen * scr)
|
||||
void rebind_key_grabs(WScreen *scr)
|
||||
{
|
||||
WWindow *wwin;
|
||||
|
||||
@@ -1479,7 +1479,7 @@ static WMenu *makeDefaultMenu(WScreen * scr)
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals)
|
||||
WMenu *configureMenu(WScreen *scr, WMPropList *definition, Bool includeGlobals)
|
||||
{
|
||||
WMenu *menu = NULL;
|
||||
WMPropList *elem;
|
||||
@@ -1730,5 +1730,5 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard)
|
||||
}
|
||||
|
||||
if (scr->flags.root_menu_changed_shortcuts)
|
||||
rebindKeygrabs(scr);
|
||||
rebind_key_grabs(scr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user