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

Need new keyboard layout : Keyboard layout changes on client connection loss #3348

Closed
Chesters-CZ opened this issue Dec 18, 2024 · 7 comments
Labels

Comments

@Chesters-CZ
Copy link

xrdp version

0.9.21.1

Detailed xrdp version, build options

root@CHESTERS-SERVER:/home/chesters# sudo xrdp --version
xrdp 0.9.21.1
  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 -ffile-prefix-map=/build/xrdp-QTF2mN/xrdp-0.9.21.1=. -fstack-protector-strong -Wformat -Werror=format-security 
      LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed
      CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 
      PKG_CONFIG_PATH=/build/xrdp-QTF2mN/xrdp-0.9.21.1/pkgconfig

  Compiled with OpenSSL 3.0.14 4 Jun 2024
root@CHESTERS-SERVER:/home/chesters# 

Operating system & version

Debian GNU/Linux 12 (bookworm)

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

?

What desktop environment do you use?

GNOME

Environment xrdp running on

Dell PowerEdge R510 server with MGA G200eW WPCM450 GPU

What's your client?

Remote Desktop Connection (C:\WINDOWS\system32\mstsc.exe) running on a Windows 11 machine

Area(s) with issue?

Keyboard / Mouse

Steps to reproduce

  1. Connect via Remote Desktop Connection:
    image
  2. Disconnect client from network
  3. Reconnect client to network
  4. Connect via Remote Desktop Connection again

✔️ Expected Behavior

Keyboard layout after step 1 should be the same as after step 4 (for me, Czech QWERTZ)

❌ Actual Behavior

The layout after step 1 is correct - Czech QWERTZ
The layout after step 4 is different - English QWERTY or some kind of cyrillic layout

Anything else?

Keyboard layout gets fixed after logging out and logging back in. The keyboard layout in the Gnome settings stays unchanged:
image

xrdp-sesman.log
xrdp.log
xorg.conf.txt
Github does not accept the .conf filetype, so I appended .txt.

@matt335672
Copy link
Member

This seems to be down to the Czech keyboard layout not being supported.

The keyboard identifier for the Czech keyboard (from here) is 00000405. This can be seen from the xrdp.log log file which shows a fallback to the US keyboard:-

20241217-19:25:04] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x07], keyboard_subtype:[0x00], keylayout:[0x00000405]
. . .
[20241217-19:25:05] [WARN ] Cannot find keymap file /etc/xrdp/km-00000405.ini
[20241217-19:25:05] [WARN ] Cannot find keymap file /etc/xrdp/km-00000405.ini
[20241217-19:25:05] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini

We're no longer supporting xrdp v0.9.x apart from security fixes. However, I can put a patch together for you for v0.10.x, which would probably work for v0.9.x. Would you be interested in trying that?

@Chesters-CZ
Copy link
Author

Sure, @matt335672, I'd be happy to ^^

@matt335672
Copy link
Member

Thanks.

I'm looking at the Windows layout for the Czech keyboard (code 0405) here:-

https://www.kbdlayout.info/kbdcz

The GNOME layout from a screenshot is here:-

image

These look different to me (but I'm not a Czech speaker). Is this what you'd expect in moving from Windows to GNOME, or am I missing something?

@Chesters-CZ
Copy link
Author

Yes, the Windows and Linux keyboard layouts are different. I don't know why that is, but it seems to be a Linux-wide difference not exclusive to GNOME. The Linux variant of the Czech layout is the same on Arch with Plasma and Debian without a GUI, too.

It's most likely just a difference for the sake of there being a difference. It doesn't really matter in day-to-day typing.

@matt335672
Copy link
Member

I've got a PR #3358 out for V0.10 to add the Czech keyboard.

It won't go into the next v0.10.x release which is imminent, but it will go into the next release, whatever that is.

To use retro-fit this to v0.9.x

  1. Get the keyboard file km-00000405.ini by using this command, and copy it to /etc/xrdp/:-

     wget https://raw.githubusercontent.com/neutrinolabs/xrdp/a6dbca20783dd46e8b5d8e1fdaf7b52c5647dce5/instfiles/km-00000405.ini
  2. Edit /etc/xrdp/xrdp_keyboard.ini, and make the changes shown below:-

--- a/xrdp/xrdp_keyboard.ini
+++ b/xrdp/xrdp_keyboard.ini
@@ -60,6 +60,7 @@ layouts_map=default_layouts_map
 rdp_layout_us=0x00000409
 rdp_layout_us_dvorak=0x00010409
 rdp_layout_us_dvp=0x19360409
+rdp_layout_cz=0x00000405
 rdp_layout_dk=0x00000406
 rdp_layout_de=0x00000407
 rdp_layout_es=0x0000040A
@@ -88,6 +89,7 @@ rdp_layout_pt=0x00000816
 rdp_layout_us=us
 rdp_layout_us_dvorak=us(dvorak)
 rdp_layout_us_dvp=us(dvp)
+rdp_layout_cz=cz
 rdp_layout_dk=dk
 rdp_layout_de=de
 rdp_layout_es=es
@@ -127,6 +129,7 @@ layouts_map=default_layouts_map
 rdp_layout_us=us
 rdp_layout_us_dvorak=us(dvorak)
 rdp_layout_us_dvp=us(dvp)
+rdp_layout_cz=cz
 rdp_layout_dk=dk
 rdp_layout_de=de
 rdp_layout_es=es

In summary, all lines with a _dk have a line with a _cz added above them.

@Chesters-CZ - please try that and let us know how you get on.

@Chesters-CZ
Copy link
Author

Thank you, this fixed the issue.
Merry Christmas :)

@matt335672 matt335672 changed the title Keyboard layout changes on client connection loss Need new keyboard layout : Keyboard layout changes on client connection loss Dec 24, 2024
@matt335672
Copy link
Member

Thanks @Chesters-CZ

I've changed the title of this issue so other people may be able to find it.

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

No branches or pull requests

2 participants