Commits on Source (3)
-
Olivier Fourdan authored
For Xwayland, we need to be able to send the events that would normally be processed by the normal Xserver event processing to be forwarded to the Wayland compositor (somehow). Add a new hook “DeviceSendEventsProc” attached to the device so that Xwayland can implement its own routine instead of the “normal” XTEST implementation which generates and processes X input events. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com>
-
This adds support for XTEST in Xwayland using EIS, the emulated input library [1]. To differentiate between X11 clients using XTEST, initiate a EI context for each client and use the actual client name, from its command line. When an X11 client first tries to use XTEST to generate emulated input events, a new connection to libEI is initiated by Xwayland on behalf of the X11 client. During that connection phase, the EI server will not be accepting events until the emulated device is actually created, meaning that any XTEST request from the X11 client will be discarded until the EI server is willing to accept events. To avoid that issue, add an event queue in Xwayland per X11 client that will keep those requests, and dequeue them as soon as the EI server is ready, i.e. once the EI device is added. If the X11 client disconnects from the Xserver before the EI server is ready, or if the connection is closed by the EI server, those events are discarded and the queue cleared from any pending events. For 10 minutes after the client disconnects, keep the internal struct alive. If a client with the same commandline arguments connects again, re-use the same struct. This means we are faster with the events the second time around but it also allows the EIS server to pause individual clients that keep sending intermittent events and disconnect immediately (e.g. it'd be possible to pause xdtotool while an authentication prompt is active). [1] https://gitlab.freedesktop.org/libinput/libei Thanks to Jan Beich <jbeich@FreeBSD.org> for fixing the build on BSD. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net> Co-authored-by:
Olivier Fourdan <ofourdan@redhat.com> Co-authored-by:
David Redondo <kde@david-redondo.de> Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com>
-
Olivier Fourdan authored
With optional EI support in Xwayland, we would route XTEST events to EI so that they get actually emulated in the Wayland compositor. However, this implies that EI is actually supported in various places, including the Wayland compositor of course. If, for whatever reason, we fail to use EI, the actual XTEST events will be dropped. That might be seen as a regression, as previously those would go through the usual X11 processing of events and might have worked with X11 native clients. So, to keep backward compatibility, fallback to the plain old XTEST method if EI is not available or not usable. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com>
Showing
- .gitlab-ci.yml 1 addition, 1 deletion.gitlab-ci.yml
- .gitlab-ci/debian-install.sh 10 additions, 0 deletions.gitlab-ci/debian-install.sh
- Xext/xtest.c 34 additions, 21 deletionsXext/xtest.c
- hw/xwayland/meson.build 9 additions, 0 deletionshw/xwayland/meson.build
- hw/xwayland/xwayland-input.c 11 additions, 0 deletionshw/xwayland/xwayland-input.c
- hw/xwayland/xwayland-screen.c 8 additions, 0 deletionshw/xwayland/xwayland-screen.c
- hw/xwayland/xwayland-xtest.c 927 additions, 0 deletionshw/xwayland/xwayland-xtest.c
- hw/xwayland/xwayland-xtest.h 35 additions, 0 deletionshw/xwayland/xwayland-xtest.h
- include/input.h 6 additions, 0 deletionsinclude/input.h
- include/inputstr.h 1 addition, 0 deletionsinclude/inputstr.h
- include/meson.build 2 additions, 0 deletionsinclude/meson.build
- include/xwayland-config.h.meson.in 6 additions, 0 deletionsinclude/xwayland-config.h.meson.in
- meson.build 11 additions, 0 deletionsmeson.build
- meson_options.txt 2 additions, 0 deletionsmeson_options.txt
hw/xwayland/xwayland-xtest.c
0 → 100644
This diff is collapsed.
hw/xwayland/xwayland-xtest.h
0 → 100644