From: Christophe CURIS <[email protected]> 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 <[email protected]> --- WPrefs.app/MouseSettings.c | 5 ++++- WPrefs.app/WPrefs.h | 1 + WPrefs.app/main.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c index d28f7de..4ad0433 100644 --- a/WPrefs.app/MouseSettings.c +++ b/WPrefs.app/MouseSettings.c @@ -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; } diff --git a/WPrefs.app/WPrefs.h b/WPrefs.app/WPrefs.h index 021bf3b..824010c 100644 --- a/WPrefs.app/WPrefs.h +++ b/WPrefs.app/WPrefs.h @@ -40,6 +40,7 @@ /****/ extern char *NOptionValueChanged; +extern Bool xext_xkb_supported; typedef struct _Panel Panel; diff --git a/WPrefs.app/main.c b/WPrefs.app/main.c index 561113f..d6b3946 100644 --- a/WPrefs.app/main.c +++ b/WPrefs.app/main.c @@ -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); -- 1.7.10.4 -- To unsubscribe, send mail to [email protected].
