107 lines
4.0 KiB
Diff
107 lines
4.0 KiB
Diff
From f04096af3cb7fe28914a1248498da3dc757fd73d Mon Sep 17 00:00:00 2001
|
|
From: Olivier Fourdan <ofourdan@redhat.com>
|
|
Date: Mon, 10 Feb 2025 15:38:18 +0100
|
|
Subject: [PATCH xserver] Revert "xwayland: Don't run key behaviors and
|
|
actions"
|
|
|
|
Due to a bug in gamescope who does not send the Wayland modifiers
|
|
events, this is causing a regression in X11 clients running on Xwayland
|
|
in gamescope, where the modifiers are not applied anymore.
|
|
|
|
This reverts commit cea92a3e0900eb611b2e683edf11272d4e306a77.
|
|
|
|
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1790
|
|
See-also: https://github.com/ValveSoftware/gamescope/issues/1740
|
|
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1781>
|
|
---
|
|
hw/xwayland/xwayland-input.c | 7 ++-----
|
|
include/inputstr.h | 2 --
|
|
xkb/xkbActions.c | 9 +++------
|
|
xkb/xkbPrKeyEv.c | 2 +-
|
|
4 files changed, 6 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
|
|
index 41434a89a..53cc5144b 100644
|
|
--- a/hw/xwayland/xwayland-input.c
|
|
+++ b/hw/xwayland/xwayland-input.c
|
|
@@ -1284,12 +1284,11 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard,
|
|
old_state = dev->key->xkbInfo->state;
|
|
new_state = &dev->key->xkbInfo->state;
|
|
|
|
- new_state->base_group = 0;
|
|
- new_state->latched_group = 0;
|
|
new_state->locked_group = group & XkbAllGroupsMask;
|
|
new_state->base_mods = mods_depressed & XkbAllModifiersMask;
|
|
- new_state->latched_mods = mods_latched & XkbAllModifiersMask;
|
|
new_state->locked_mods = mods_locked & XkbAllModifiersMask;
|
|
+ XkbLatchModifiers(dev, XkbAllModifiersMask,
|
|
+ mods_latched & XkbAllModifiersMask);
|
|
|
|
XkbComputeDerivedState(dev->key->xkbInfo);
|
|
|
|
@@ -1677,7 +1676,6 @@ add_device(struct xwl_seat *xwl_seat,
|
|
dev->public.devicePrivate = xwl_seat;
|
|
dev->type = SLAVE;
|
|
dev->spriteInfo->spriteOwner = FALSE;
|
|
- dev->ignoreXkbActionsBehaviors = TRUE;
|
|
|
|
return dev;
|
|
}
|
|
@@ -3599,7 +3597,6 @@ InitInput(int argc, char *argv[])
|
|
|
|
mieqInit();
|
|
|
|
- inputInfo.keyboard->ignoreXkbActionsBehaviors = TRUE;
|
|
xwl_screen->input_registry = wl_display_get_registry(xwl_screen->display);
|
|
wl_registry_add_listener(xwl_screen->input_registry, &input_listener,
|
|
xwl_screen);
|
|
diff --git a/include/inputstr.h b/include/inputstr.h
|
|
index 269399e1d..24dd48841 100644
|
|
--- a/include/inputstr.h
|
|
+++ b/include/inputstr.h
|
|
@@ -631,8 +631,6 @@ typedef struct _DeviceIntRec {
|
|
DeviceSendEventsProc sendEventsProc;
|
|
|
|
struct _SyncCounter *idle_counter;
|
|
-
|
|
- Bool ignoreXkbActionsBehaviors; /* TRUE if keys don't trigger behaviors and actions */
|
|
} DeviceIntRec;
|
|
|
|
typedef struct {
|
|
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
|
|
index 8dd9d7da0..5e9a6b6d6 100644
|
|
--- a/xkb/xkbActions.c
|
|
+++ b/xkb/xkbActions.c
|
|
@@ -1368,12 +1368,9 @@ XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event)
|
|
(event->type == ET_ButtonPress));
|
|
|
|
if (pressEvent) {
|
|
- if (keyEvent) {
|
|
- if (kbd->ignoreXkbActionsBehaviors)
|
|
- act.type = XkbSA_NoAction;
|
|
- else
|
|
- act = XkbGetKeyAction(xkbi, &xkbi->state, key);
|
|
- } else {
|
|
+ if (keyEvent)
|
|
+ act = XkbGetKeyAction(xkbi, &xkbi->state, key);
|
|
+ else {
|
|
act = XkbGetButtonAction(kbd, dev, key);
|
|
key |= BTN_ACT_FLAG;
|
|
}
|
|
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
|
|
index 53a31b727..d2c7e33f4 100644
|
|
--- a/xkb/xkbPrKeyEv.c
|
|
+++ b/xkb/xkbPrKeyEv.c
|
|
@@ -68,7 +68,7 @@ XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd)
|
|
/* do anything to implement the behavior, but it *does* report that */
|
|
/* key is hardwired */
|
|
|
|
- if (!keybd->ignoreXkbActionsBehaviors && !(behavior.type & XkbKB_Permanent)) {
|
|
+ if (!(behavior.type & XkbKB_Permanent)) {
|
|
switch (behavior.type) {
|
|
case XkbKB_Default:
|
|
/* Neither of these should happen in practice, but ignore them
|
|
--
|
|
2.48.1
|
|
|