Bug 388112 - starting games under wayland will show pointer lock notification
Summary: starting games under wayland will show pointer lock notification
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D9618
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-21 12:12 UTC by farmboy0
Modified: 2018-01-03 20:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description farmboy0 2017-12-21 12:12:00 UTC
When starting games or switching to them with Alt-TAB kwin will show a notification about pointer lock. This seems to draw focus from the application window for as long as this notification is shown the game window doesnt receive keyboard events.

Real example:
I am running Final Fantasy XI under wine. I'm using wine's virtual desktop mode.
While the game is running I often switch between the wine window and firefox.
Everytime I switch back to wine this notification is shown and I have to wait till it's gone to resume playing.

This happens only with wayland.
Comment 1 Martin Flöser 2017-12-21 15:16:11 UTC
The window only informs that the application grabbed the pointer. It does not steal any key events.
Comment 2 Gareth Hart 2018-01-02 19:25:33 UTC
I have found that the pointer lock and pointer motion notifications using KWin and Wayland will prevent any keyboard input for the three seconds that the notification appears on screen.

When I use Vivaldi and either move or resize a window, the pointer motion notification appears and I am unable to input anything using the keyboard within that window until the notification disappears. The mouse reacts fine within the same window during the same period. When I am filling in forms in a new window, it can get tiresome when it repeatedly happens.

I have also noticed that this also happened with the video game 7 Days to Die which I have been gifted via Steam.
Comment 3 Martin Flöser 2018-01-02 20:35:54 UTC
First of all: I believe you. I just write how the code is supposed to work.

Could you please tell me which Qt version you are using?
Comment 4 Martin Flöser 2018-01-02 20:41:00 UTC
Hmm I think I found the problem.
Comment 5 farmboy0 2018-01-02 20:43:17 UTC
I am using Qt 5.9.3.
Comment 6 Martin Flöser 2018-01-02 20:54:42 UTC
Possible patch at: https://phabricator.kde.org/D9618

If you have any chance to test this, it would be appreciated. I probably won't have any time to test today or tomorrow.
Comment 7 Gareth Hart 2018-01-02 20:58:03 UTC
(In reply to Martin Flöser from comment #3)
> First of all: I believe you. I just write how the code is supposed to work.
> 
> Could you please tell me which Qt version you are using?
QT 5.10.0 on Arch Linux.
Comment 8 farmboy0 2018-01-03 18:54:12 UTC
The patch seems to help with my use case. Keyboard input is now possible while the notification is shown.

Thank you
Comment 9 Martin Flöser 2018-01-03 20:09:39 UTC
Wonderful! Thanks for testing
Comment 10 Martin Flöser 2018-01-03 20:13:47 UTC
Git commit f5f1f6ceb49d0d699675a98a8556ff16f9ec9525 by Martin Flöser.
Committed on 03/01/2018 at 20:13.
Pushed by graesslin into branch 'master'.

Don't send keyboard events to QWindows which have outputOnly property set

Summary:
PlasmaCore.Dialog has a property outputOnly. This is for example used in
KWin's OnScreenNotification. If that property is set KWin should not send
any key events to it, just like for windows with _q_showWithoutActivating.

Test Plan: Not yet

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9618

M  +3    -0    input.cpp

https://commits.kde.org/kwin/f5f1f6ceb49d0d699675a98a8556ff16f9ec9525