Bug 433155 - Stuck key in Xwayland
Summary: Stuck key in Xwayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: 5.21.0
Platform: openSUSE Linux
: VHI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-18 11:07 UTC by Fabian Vogt
Modified: 2021-03-16 16:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Session output with KWIN_XWAYLAND_DEBUG=1 (50.34 KB, application/x-xz)
2021-02-23 19:28 UTC, Fabian Vogt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Vogt 2021-02-18 11:07:32 UTC
In the dolphin test, openQA presses F10 to open the "New Folder" dialog, enters a name and presses return. At some later point, the "New Folder" dialog shows up again for seemingly no reason. When this issue appears, it can be observed that in all X11 windows (xterm, xev, ...), the F10 key gets pressed repeatedly.

https://openqa.opensuse.org/tests/1634324#step/dolphin/23

This issue doesn't appear on Plasma 5.20.

Sounds similar to https://bugs.kde.org/show_bug.cgi?id=372807
Comment 1 David Edmundson 2021-02-18 11:57:41 UTC
Can you confirm if dolphin is run as x11 or wayland during this test?
Comment 2 Fabian Vogt 2021-02-18 12:12:24 UTC
(In reply to David Edmundson from comment #1)
> Can you confirm if dolphin is run as x11 or wayland during this test?

X11. dolphin -platform wayland is not affected, dolphin -platform xcb is.

So far I failed to reproduce this issue locally. I only see it in the dolphin test in openQA, in ~90% of all runs.
Comment 3 David Edmundson 2021-02-21 23:01:02 UTC
I also can't reproduce locally. 

If possible can you set kwin's env to includ

KWIN_XWAYLAND_DEBUG and include
Comment 4 David Edmundson 2021-02-21 23:02:11 UTC
I also can't reproduce locally. 

If possible can you set kwin's env to include:
KWIN_XWAYLAND_DEBUG

and attach the output of kwin?
Comment 5 Fabian Vogt 2021-02-23 19:28:24 UTC
Created attachment 136088 [details]
Session output with KWIN_XWAYLAND_DEBUG=1

I started some openQA test runs which append KWIN_XWAYLAND_DEBUG=1 to /etc/environment before logging into a wayland session.
While the first two runs passed, the next two failed. I attached the output of the test run where I disabled most unrelated test modules:
https://openqa.opensuse.org/tests/1643557#step/dolphin/7 shows the point when it presses F10.

Apparently the scancode for F10 is 68, and indeed there's only a press event ("[1545784.319] wl_keyboard@20.key(594, 310481, 68, 1)"), but no release event for that key.
Comment 6 Vlad Zahorodnii 2021-02-25 09:09:30 UTC
It's quite possible that implicit grabs in SeatInterface are broken. If you press a key, the client should receive the corresponding release event no matter what.
Comment 7 Vlad Zahorodnii 2021-02-25 09:25:04 UTC
Hmm, the spec only mentions implicit grabs for the pointer, but in general there is also an implicit grab for the keyboard.
Comment 8 Vlad Zahorodnii 2021-03-15 09:43:04 UTC
not sure, but https://invent.kde.org/plasma/kwayland-server/-/merge_requests/192 may fix this issue
Comment 9 Nate Graham 2021-03-15 14:50:15 UTC
Since that's been merged now, can you test, Fabian?
Comment 10 Fabian Vogt 2021-03-15 14:56:02 UTC
(In reply to Nate Graham from comment #9)
> Since that's been merged now, can you test, Fabian?

I'll report back what the next few openQA runs return.
Comment 11 Fabian Vogt 2021-03-16 16:08:34 UTC
(In reply to Fabian Vogt from comment #10)
> (In reply to Nate Graham from comment #9)
> > Since that's been merged now, can you test, Fabian?
> 
> I'll report back what the next few openQA runs return.

I started six test runs for this and they all returned green, which is a good sign! As with all random issues, I can't tell for sure whether it's fixed, but I'm optimistic here.