1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-05 05:14:13 +01:00

WPrefs: Fixed empty list of Mouse Grab Modifier problem

The original code was assuming that the Xkb extension is available
everywhere, which is not the case. This resulted in all modifiers
to be seen as NoSymbol, thus the empty list.

Now we initialize properly the Xkb extension at the start of the
program, and provide a work-around with the historical function in
the case the ext would not be available.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-06-15 14:38:43 +02:00
committed by Carlos R. Mafra
parent 5d2fb4ec97
commit 0382dd5dd7
3 changed files with 9 additions and 1 deletions

View File

@@ -361,7 +361,10 @@ static void fillModifierPopUp(WMPopUpButton * pop)
if (mapping->modifiermap[idx] != 0) {
int l;
for (l = 0; l < 4; l++) {
ksym = XkbKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0, l);
if (xext_xkb_supported)
ksym = XkbKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0, l);
else
ksym = XKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0);
if (ksym != NoSymbol)
break;
}

View File

@@ -40,6 +40,7 @@
/****/
extern char *NOptionValueChanged;
extern Bool xext_xkb_supported;
typedef struct _Panel Panel;

View File

@@ -23,11 +23,13 @@
#include <assert.h>
#include <X11/Xlocale.h>
#include <X11/XKBlib.h>
#include <sys/wait.h>
#include <unistd.h>
char *NOptionValueChanged = "NOptionValueChanged";
Bool xext_xkb_supported = False;
#define MAX_DEATHS 64
@@ -162,6 +164,8 @@ int main(int argc, char **argv)
exit(0);
}
xext_xkb_supported = XkbQueryExtension(dpy, NULL, NULL, NULL, NULL, NULL);
WMPLSetCaseSensitive(False);
Initialize(scr);