Bug 1148203

Summary: [Wayland][Gnome] Keyboard input handled twice on focus change
Product: [Fedora] Fedora Reporter: Christian Stadelmann <fedora>
Component: waylandAssignee: Adam Jackson <ajax>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: ajax, cbredesen, mclasen, ofourdan
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-01 09:28:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1277927    

Description Christian Stadelmann 2014-09-30 23:36:48 UTC
Description of problem:
When keyboard input triggers focus change from one window to another, both windows get the keyboard input.

Version-Release number of selected component (if applicable):
F21 Alpha gnome-session-wayland-session

How reproducible:
often, e.g. when focus moves from
gnome-shell (overview, search) to any application (e.g. geany, gedit, gnome-terminal)
gnome-terminal (on exit) to any application (see above)
any dialog (e.g. from polkit, gpg, …) over any application

Steps to Reproduce:
1. Open one instance of gnome-terminal
2. start `$ xinput test`
3. start another instance of gnome-terminal
4. focus on the second terminal
5. type "exit" and execute with enter key

Actual results:
first terminal quits, second terminal gets the enter key press. both terminals recieve the enter key press. when `$ xinput test` is running in the first terminal, it will see the press and release of enter key twice.

Expected results:
Only the currently focused application should get the input.

Comment 1 Christian Stadelmann 2014-10-16 21:46:53 UTC
This bug is fixed with gnome 3.14.1 release. closing.

Comment 2 Christian Stadelmann 2015-05-04 18:50:14 UTC
This bug is still present in some way in gnome 3.16 / Fedora 22. the steps to reproduce just don't work any more since gnome-terminal-server runs on wayland backend thus xinput can't get keyboard input of other processes. But it can be reproduced by these steps:

1. open gnome-terminal
2. run `xinput --test-xi2`
3. open another window, do something there. close the window e.g. by pressing "X" or typing "exit[Enter]" if it is a terminal

You will see that the key event (by mouse or keyboard) will be split up to two applications. the "key down" event will be sent to one application, the "key up" event to the other one.

This has major impact as it will in some cases "lock" the pressed key. If you e.g. have a terminal closed by entering "exit" and pressing the [Enter] key and afterwards a nautilus window gets focus it will try to open the selected file until it looses focus. This will probably freeze the system until an out-of-memory killer starts its work. Result: Bad user experience.

Comment 3 Christian Stadelmann 2015-09-03 15:25:23 UTC
Still present on current F23 Alpha with gnome 3.17.90 as of today. Happens less often as far as I can tell.

Comment 4 Christian Stadelmann 2015-11-24 21:04:41 UTC
Sometimes this issue happens when using <Meta/Super>+<Tab> to switch windows between 2 XWayland applications. Gnome-shell then keeps switching focus between the two most recently active application windows. This cannot be aborted by pressing <Metal>+<Tab> again. Instead you need to e.g. press <Alt>+<Tab>.

Comment 5 Chris Bredesen 2016-05-10 21:20:34 UTC
I see an issue with Firefox when I Alt-Tab away from it - the menubar momentarily shows since Alt is a trigger key to show the menu. Is this a manifestation of this issue? If not, I can file another...

Comment 6 Christian Stadelmann 2016-05-11 21:23:58 UTC
(In reply to Chris Bredesen from comment #5)
> I see an issue with Firefox when I Alt-Tab away from it - the menubar
> momentarily shows since Alt is a trigger key to show the menu. Is this a
> manifestation of this issue? If not, I can file another...

I don't know that for sure. At least it doesn't happen on X11 but on wayland. And I can confirm this too.

Comment 7 Olivier Fourdan 2016-08-31 15:16:45 UTC
This one is fixed in Xwayland upstream - https://bugs.freedesktop.org/show_bug.cgi?id=97467

Comment 8 Olivier Fourdan 2016-08-31 15:20:21 UTC
Fixed in xorg-x11-server-Xwayland-1.18.4-4

Comment 9 Matthias Clasen 2016-08-31 19:55:49 UTC
then I guess we should close this ?