diff options
Diffstat (limited to 'xorg/X11R7.6/rdp')
-rw-r--r-- | xorg/X11R7.6/rdp/rdp.h | 2 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpinput.c | 79 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpup.c | 6 |
3 files changed, 41 insertions, 46 deletions
diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 7bc2eb6c..00725d11 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -508,7 +508,7 @@ KbdAddEvent(int down, int param1, int param2, int param3, int param4); void KbdSync(int param1); int -rdpLoadLayout(int keylayout); +rdpLoadLayout(struct xrdp_client_info *client_info); /* rdpup.c */ int diff --git a/xorg/X11R7.6/rdp/rdpinput.c b/xorg/X11R7.6/rdp/rdpinput.c index 7fb20379..ef0bb929 100644 --- a/xorg/X11R7.6/rdp/rdpinput.c +++ b/xorg/X11R7.6/rdp/rdpinput.c @@ -282,7 +282,7 @@ rdpChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) /******************************************************************************/ int -rdpLoadLayout(int keylayout) +rdpLoadLayout(struct xrdp_client_info *client_info) { XkbRMLVOSet set; XkbSrvInfoPtr xkbi; @@ -292,8 +292,10 @@ rdpLoadLayout(int keylayout) KeyCode first_key; CARD8 num_keys; - LLOGLN(0, ("rdpLoadLayout: keylayout 0x%8.8x display %s", - keylayout, display)); + int keylayout = client_info->keylayout; + + LLOGLN(0, ("rdpLoadLayout: keylayout 0x%8.8x variant %s display %s", + keylayout, client_info->variant, display)); memset(&set, 0, sizeof(set)); if (g_use_evdev) { @@ -303,42 +305,26 @@ rdpLoadLayout(int keylayout) { set.rules = "base"; } + set.model = "pc104"; set.layout = "us"; - switch (keylayout) - { - case 0x00000407: /* German */ - set.layout = "de"; - break; - case 0x00000409: /* US */ - set.layout = "us"; - break; - case 0x0000040C: /* French */ - set.layout = "fr"; - break; - case 0x00000410: /* Italian */ - set.layout = "it"; - break; - case 0x00000416: /* Portuguese (Brazilian ABNT) */ - set.model = "abnt2"; - set.layout = "br"; - break; - case 0x00000419: /* Russian */ - set.layout = "ru"; - break; - case 0x0000041D: /* Swedish */ - set.layout = "se"; - break; - case 0x00000816: /* Portuguese */ - set.layout = "pt"; - break; - default: - LLOGLN(0, ("rdpLoadLayout: unknown keylayout 0x%8.8x", keylayout)); - break; - } set.variant = ""; set.options = ""; + if (strlen(client_info->model) > 0) + { + set.model = client_info->model; + } + if (strlen(client_info->variant) > 0) + { + set.variant = client_info->variant; + } + if (strlen(client_info->layout) > 0) + { + set.layout = client_info->layout; + } + + retry: /* free some stuff so we can call InitKeyboardDeviceStruct again */ xkbi = g_keyboard->key->xkbInfo; xkb = xkbi->desc; @@ -355,21 +341,30 @@ rdpLoadLayout(int keylayout) rdpChangeKeyboardControl)) { LLOGLN(0, ("rdpLoadLayout: InitKeyboardDeviceStruct failed")); + return 1; } /* notify the X11 clients eg. X_ChangeKeyboardMapping */ keySyms = XkbGetCoreMap(g_keyboard); - first_key = keySyms->minKeyCode; - num_keys = (keySyms->maxKeyCode - keySyms->minKeyCode) + 1; - XkbApplyMappingChange(g_keyboard, keySyms, first_key, num_keys, - NULL, serverClient); - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) + if (keySyms) { - if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) + first_key = keySyms->minKeyCode; + num_keys = (keySyms->maxKeyCode - keySyms->minKeyCode) + 1; + XkbApplyMappingChange(g_keyboard, keySyms, first_key, num_keys, + NULL, serverClient); + for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { - XkbApplyMappingChange(pDev, keySyms, first_key, num_keys, - NULL, serverClient); + if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) + { + XkbApplyMappingChange(pDev, keySyms, first_key, num_keys, + NULL, serverClient); + } } + } else + { + /* sometimes, variant doesn't support all layouts */ + set.variant = ""; + goto retry; } return 0; diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index 83525251..f25b390a 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -1117,7 +1117,7 @@ rdpup_process_msg(struct stream *s) g_do_multimon = 0; } - rdpLoadLayout(g_rdpScreen.client_info.keylayout); + rdpLoadLayout(&(g_rdpScreen.client_info)); } else if (msg_type == 105) @@ -1563,7 +1563,7 @@ convert_pixel(int in_pixel) if (g_rdpScreen.depth == 24) { - if (g_rdpScreen.rdp_bpp == 24) + if (g_rdpScreen.rdp_bpp >= 24) { rv = in_pixel; SPLITCOLOR32(red, green, blue, rv); @@ -1619,7 +1619,7 @@ convert_pixels(void *src, void *dst, int num_pixels) { src32 = (unsigned int *)src; - if (g_rdpScreen.rdp_bpp == 24) + if (g_rdpScreen.rdp_bpp >= 24) { dst32 = (unsigned int *)dst; |