diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2018-07-16 22:23:56 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-09 15:31:57 +0100 |
commit | 05e03b965855e13557745d25eabe63698cb61bc1 (patch) | |
tree | 06a4502b98b2b82f6e144c13edf31a212b330deb /nx-X11/programs/Xserver/hw/nxagent | |
parent | d8bbbcf29c3c0e43ce28d76e52e6a8ad9deeb90f (diff) | |
download | nx-libs-05e03b965855e13557745d25eabe63698cb61bc1.tar.gz nx-libs-05e03b965855e13557745d25eabe63698cb61bc1.tar.bz2 nx-libs-05e03b965855e13557745d25eabe63698cb61bc1.zip |
Keyboard.c: greatly simplify the code in nxagentKeyboardProc
most of the code was existing twice
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 44 |
1 files changed, 13 insertions, 31 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 84121c1db..ff23ba232 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -828,39 +828,16 @@ XkbError: nxagentKeycodeConversionSetup(); - if (xkb == NULL || xkb->geom == NULL) + if (xkb && xkb->geom) { - #ifdef TEST - fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); - if (xkb == NULL) - { - fprintf(stderr, "nxagentKeyboardProc: xkb is null.\n"); - } - else - { - fprintf(stderr, "nxagentKeyboardProc: xkb->geom is null.\n"); - } - fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n"); - #endif - #ifdef DEBUG - fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: " - "[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n", - rules, model, layout, variants, options); - #endif - - XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, - nxagentBell, nxagentChangeKeyboardControl); - - if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0) - { - goto XkbError; - } - - goto XkbEnd; + XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); } - - XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); +#ifdef TEST + else + { + fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); + } +#endif #ifdef DEBUG fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: " @@ -877,6 +854,11 @@ XkbError: goto XkbError; } + if (xkb && xkb->geom) + { + XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); + } + if (nxagentOption(Shadow) == 1 && pDev && pDev->key) { NXShadowInitKeymap(&(pDev->key->curKeySyms)); |