Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dvorak keymap not loaded after login #3081

Closed
iskunk opened this issue May 21, 2024 · 4 comments · Fixed by #3112
Closed

Dvorak keymap not loaded after login #3081

iskunk opened this issue May 21, 2024 · 4 comments · Fixed by #3112
Labels

Comments

@iskunk
Copy link
Contributor

iskunk commented May 21, 2024

xrdp version

0.9.24

Detailed xrdp version, build options

xrdp 0.9.24
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --enable-ipv6
      --enable-jpeg
      --enable-fuse
      --enable-rfxcodec
      --enable-opus
      --enable-painter
      --enable-vsock
      --build=x86_64-linux-gnu
      --prefix=/usr
      --includedir=${prefix}/include
      --mandir=${prefix}/share/man
      --infodir=${prefix}/share/info
      --sysconfdir=/etc
      --localstatedir=/var
      --disable-silent-rules
      --libdir=${prefix}/lib/x86_64-linux-gnu
      --libexecdir=${prefix}/lib/x86_64-linux-gnu
      --disable-maintainer-mode
      --disable-dependency-tracking
      --with-socketdir=/run/xrdp/sockdir
      build_alias=x86_64-linux-gnu
      CFLAGS=-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/xrdp-0.9.24=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
      LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed
      CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 
      PKG_CONFIG_PATH=/build/reproducible-path/xrdp-0.9.24/pkgconfig

  Compiled with OpenSSL 3.2.2-dev 

Operating system & version

Debian sid

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

xorgxrdp

What desktop environment do you use?

any

Environment xrdp running on

VM

What's your client?

xfreerdp

Area(s) with issue?

Keyboard / Mouse

Steps to reproduce

From an X11 session with the Dvorak keymap loaded, log into a remote system via xrdp.

✔️ Expected Behavior

After getting past the login dialog, the Dvorak keymap (same as on the client system) is active in the remote framebuffer.

❌ Actual Behavior

The QWERTY keymap was active.

Anything else?

Please refer to the bug report I filed in Debian for more background on this issue, and the fix:
https://bugs.debian.org/1071556

@iskunk iskunk added the bug label May 21, 2024
@metalefty
Copy link
Member

What is your command line option to xfreerdp?

@iskunk
Copy link
Contributor Author

iskunk commented May 22, 2024

For testing, I used this invocation: xfreerdp /bpp:24 /kbd:0x00010409 /size:1200x900 /v:hostname

However, I first encountered the problem with Remmina (which correctly auto-detects the 0x10409/Dvorak keymap), logging into Ubuntu 24.04 via xrdp for the first time.

@metalefty
Copy link
Member

OK, I wanted to confirm FreeRDP is telling to xrdp server that the client keymap is Dvorak.

To break down a problem, could you try to put the following file as startwm.sh at the top of your home directory (with execute permission)? Close all xrdp existing sessions and reconnect to a new session. Then your session will be quite simple like the attached screenshot.

#!/bin/sh
xterm

See what keyboard layout is applied.

image

See also xorgxrdp log (optional).

[ 52686.638] rdpRRConnectOutput:
[ 52686.638]   client can not do offscreen to offscreen blits
[ 52686.638]   client can do new(color) cursor
[ 52686.638] rdpLoadLayout: keylayout 0x00010409 variant  display 11 <-- this line
[ 52686.648] rdpkeybChangeKeyboardControl:
[ 52686.648] rdpkeybChangeKeyboardControl: autoRepeat on
[ 52686.648] rdpkeybChangeKeyboardControl:

@iskunk
Copy link
Contributor Author

iskunk commented May 22, 2024

I set up an xterm-only session. The behavior is the same: if the config file has rdp_layout_us_dvorak=dvorak, I get QWERTY in the xterm. If it has rdp_layout_us_dvorak=us(dvorak), I get Dvorak. The Debian/Ubuntu packaging of xrdp does not make an xorgxrdp log available, but I do see this:

$ grep xrdp_load_keyboard_layout /var/log/xrdp.log
[20240522-02:45:11] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0x00010409]
[20240522-02:45:11] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [dvorak] options []
[20240522-02:45:34] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0x00010409]
[20240522-02:45:34] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [us(dvorak)] options []

You can confirm the behavior change using setxkbmap(1). On an old system, you can do

$ setxkbmap dvorak
$

On a new system (like Ubuntu 24.04), however, you get an error:

$ setxkbmap dvorak
Error loading new keyboard description
$ setxkbmap 'us(dvorak)'
$

Note that dvorak was an alias for us(dvorak). The latter has always been supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants