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

More evdev keyboard changes #333

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

matt335672
Copy link
Member

Fixes neutrinolabs/xrdp#1721

This commit removes some unused code from the keyboard driver, and fixes a rare race condition between the Xorg server starting and the first RDP client connecting (see neutrinolabs/xrdp#1721)

Keyboard layout logging is also somewhat improved. On X server startup, a line like this is logged:-

[  4800.882] rdpLoadLayout: rules="evdev" model="pc104" variant=""layout="us" options=""

Following a client connect, the change is logged:-

[  4814.777] rdpLoadLayout: rules="evdev" model="pc104" variant=""layout="gb" options=""

The single call to rdpkeybDeviceInit() in rdpkeybControl() initialises some
local variables which are then unused.

This commit removes the local variables, the call to rdpkeybDeviceInit()
and the dependences of rdpkeybDeviceInit() which are not used elsewhere.
The keyboard layout is set when the keyboard is initialised and when
a client connects.

When the X server is started and the keyboard is initialised,
client layout info is unavailable. Therefore, a default layout
is set. Subsequent calls are made when a client connects to the X
server. These calls set the client layout for the currently connected
RDP client.

The amount of time which may elapse between the X server starting and
the first RDP client connecting may be considerable - a session could
be started without a client using xrdp-sesrun. Or, it may be only a
second or so, if the X server is started by a connection to xrdp.

The two codepaths for setting the layout are separate. The initialisation
codepath appears to be deficient in that the layout is not also set
on inputInfo.keyboard. This seems to cause problems where X11 clients
can end up loading the wrong layout where an RDP client has not yet
connected. See (for example):-

neutrinolabs/xrdp#1721

This is pretty rare, but when it happens is difficult to debug.

This commit unifies the codepaths so that the same code is always used
when the layout changes.
@jsorg71
Copy link
Contributor

jsorg71 commented Aug 13, 2024

LGTM

@matt335672 matt335672 merged commit b6c50a9 into neutrinolabs:devel Aug 13, 2024
8 checks passed
@matt335672 matt335672 deleted the remove_g_kbdMap branch August 13, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

i3wm wizard crashes part way through vis xRDP session
2 participants