diff options
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 5fc322dde..045fa19fa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -647,14 +647,15 @@ N/A if (keymap64 == NULL) { XFreeModifiermap(modifier_keymap); - return -1; } len = (max_keycode - min_keycode + 1) * mapWidth; keymap = (KeySym *)malloc(len * sizeof(KeySym)); for(i = 0; i < len; ++i) + { keymap[i] = keymap64[i]; + } XFree(keymap64); } @@ -668,7 +669,6 @@ N/A if (keymap == NULL) { XFreeModifiermap(modifier_keymap); - return -1; } @@ -682,18 +682,24 @@ N/A memset(modmap, 0, sizeof(modmap)); for (j = 0; j < 8; j++) - for(i = 0; i < modifier_keymap->max_keypermod; i++) { + { + for(i = 0; i < modifier_keymap->max_keypermod; i++) + { CARD8 keycode; if ((keycode = modifier_keymap-> modifiermap[j * modifier_keymap->max_keypermod + i])) + { modmap[keycode] |= 1<<j; + } if (keycode > 0) { nxagentCheckModifierMasks(keycode, j); } } + } + XFreeModifiermap(modifier_keymap); modifier_keymap = NULL; @@ -747,9 +753,6 @@ XkbError: #ifdef TEST fprintf(stderr, "nxagentKeyboardProc: Using XKB extension.\n"); - #endif - - #ifdef TEST fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL"); #endif @@ -779,10 +782,9 @@ XkbError: { for (i = 0; nxagentKeyboard[i] != '/' && nxagentKeyboard[i] != 0; i++); - if(nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0) + if (nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0) { ErrorF("Warning: Wrong keyboard type: %s.\n", nxagentKeyboard); - goto XkbError; } @@ -873,7 +875,9 @@ XkbError: * instead of a file. */ if (nxagentX2go == 1) + { nxagentWriteKeyboardDir(); + } } else { @@ -891,7 +895,9 @@ XkbError: * we can drop this here. */ if (nxagentX2go == 1) + { nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions); + } } } #ifdef DEBUG @@ -905,12 +911,12 @@ XkbError: if (xkb && xkb->geom) { - XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); + XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); } #ifdef TEST else { - fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); + fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); } #endif @@ -932,7 +938,7 @@ XkbError: if (xkb && xkb->geom) { - XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); + XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); } if (nxagentOption(Shadow) == 1 && pDev && pDev->key) @@ -943,8 +949,8 @@ XkbError: if (xkb) { - XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); - xkb = NULL; + XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); + xkb = NULL; } free(model); |