Initialize xkb controls. - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 955ee1874719635a97ec0ac1fc3ad6c6f275f7e7 | |
parent 20cf9c1ad1e419eda25949b34e9ee537e4f5430d | |
Author: Rob King <[email protected]> | |
Date: Wed, 30 Nov 2016 16:52:32 -0600 | |
Initialize xkb controls. | |
Diffstat: | |
libXg/gwin.c | 2 -- | |
libXg/xtbinit.c | 6 +++++- | |
2 files changed, 5 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/libXg/gwin.c b/libXg/gwin.c | |
@@ -254,9 +254,7 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np) | |
if(e->xany.type != KeyPress) | |
return; | |
XkbTranslateKeyCode(xkb, (KeyCode)e->xkey.keycode, e->xkey.state, &md, &k); | |
- fprintf(stderr, "keycode %u, state %d, result %lu ", e->xkey.keycode, e->x… | |
XkbTranslateKeySym(e->xany.display, &k, e->xkey.state, buf, sizeof(buf) - … | |
- fprintf(stderr, " buf %s\n", buf); | |
/* Check to see if it's a specially-handled key first. */ | |
for (Keymapping *m = keymappings; m; m = m->next){ | |
diff --git a/libXg/xtbinit.c b/libXg/xtbinit.c | |
@@ -213,12 +213,16 @@ xtbinit(Errfunc f, char *class, int *pargc, char **argv, … | |
int xkbop = 0; | |
int xkbevent = 0; | |
int xkberr = 0; | |
- if (XkbQueryExtension(_dpy, &xkbop, &xkbevent, &xkberr, &xkbmajor, &xkbmin… | |
+ if (!XkbQueryExtension(_dpy, &xkbop, &xkbevent, &xkberr, &xkbmajor, &xkbmi… | |
fprintf(stderr, "could not initialize X Keyboard Extension\n"); | |
exit(EXIT_FAILURE); | |
} | |
xkb = XkbGetKeyboard(_dpy, XkbAllComponentsMask, XkbUseCoreKbd); | |
+ if (xkb == NULL || xkb->geom == NULL || XkbGetControls(_dpy, XkbAllControl… | |
+ fprintf(stderr, "could not initialize keyboard\n"); | |
+ exit(EXIT_FAILURE); | |
+ } | |
font = XftFontOpenName(_dpy, DefaultScreen(_dpy), fontspec[0] ? fontspec :… | |
screen.id = 0; |