Initialize the X Keyboard Extension correctly. - sam - An updated version of the sam text editor.
 (HTM) git clone git://vernunftzentrum.de/sam.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 7dd7ed120e00456486c99a3a64a2290402f6c92b
 (DIR) parent d61770e19e2d0b236f69f28456a31abd2199d11d
 (HTM) Author: Rob King <jking@deadpixi.com>
       Date:   Wed, 30 Nov 2016 16:03:37 -0600
       
       Initialize the X Keyboard Extension correctly.
       
       Diffstat:
         libXg/gwin.c                        |       2 --
         libXg/xtbinit.c                     |       5 +++++
       
       2 files changed, 5 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/libXg/gwin.c b/libXg/gwin.c
       @@ -255,7 +255,6 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np)
                return;
            XkbTranslateKeyCode(xkb, (KeyCode)e->xkey.keycode, e->xkey.state, &md, &k);
            XkbTranslateKeySym(e->xany.display, &k, e->xkey.state, buf, sizeof(buf) - 1, &len);
       -    fprintf(stderr, "translated keysym %s\n", buf);
        
            /* Check to see if it's a specially-handled key first. */
            for (Keymapping *m = keymappings; m; m = m->next){
       @@ -351,7 +350,6 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np)
                    STUFFCOMPOSE();
                }
                c = keysymtoshort(k);
       -        fprintf(stderr, "keysym to short: %x\n", c);
                composing = -2;
            }
        
 (DIR) diff --git a/libXg/xtbinit.c b/libXg/xtbinit.c
       @@ -208,6 +208,11 @@ xtbinit(Errfunc f, char *class, int *pargc, char **argv, char **fallbacks)
            atexit(freebindings);
            atexit(freechords);
        
       +    int ignored;
       +    if (XkbQueryExtension(_dpy, &ignored, &ignored, &ignored, &ignored, &ignored) != True){
       +        fprintf(stderr, "could not initialize X Keyboard Extension\n");
       +        exit(EXIT_FAILURE);
       +    }
            xkb = XkbGetKeyboard(_dpy, XkbAllComponentsMask, XkbUseCoreKbd);
        
            font = XftFontOpenName(_dpy, DefaultScreen(_dpy), fontspec[0] ? fontspec : getenv("FONT") ? getenv("FONT") : "monospace");