Bug 2188695 - Launched applications do not receive focus
Summary: Launched applications do not receive focus
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mutter
Version: 38
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Florian Müllner
QA Contact: Fedora Extras Quality Assurance
URL: https://gitlab.gnome.org/GNOME/mutter...
Whiteboard:
: 2190514 2192155 2210556 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-21 17:40 UTC by Silvio Bierman
Modified: 2023-08-30 12:22 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-08-30 12:22:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
No focus on newly opened Terminal window (25.23 KB, image/png)
2023-06-07 13:54 UTC, Daniel Rusek
no flags Details

Description Silvio Bierman 2023-04-21 17:40:30 UTC
Focus stays on already opened windows instead of the launched application window. The result is that you type into the obscured window instead. When launching multiple terminals this can be very confusing and possibly dangerous.

Reproducible: Always

Steps to Reproduce:
1. Login
2. Open an application (gnome terminal works, but so does Chrome)
3. See application get focus (cursor looks normal, typing works)
4. Open a second window for the same application or open any other application
5. Expect the focus to be on the newly opened application/window
6. Type anything and discover the focus is still on the previous window
7. Open any new application (even after closing all previously opened windows) and see they do not receive focus

Actual Results:  
Focus stays inside obscured window instead of newly opened one.

Expected Results:  
Set focus on the opened window.

This bug is very dangerous. I have already entered several 'kill' and 'rm' commands into the wrong terminal sessions. Just got lucky nothing matched so no disasters yet. But that is just a matter of time.

Comment 1 Daniel Rusek 2023-06-07 13:54:09 UTC
Switching to mutter since it is a mutter issue.

I have also reported this issue as BZ#2210556, however your issue is an older one, so I am closing my ticket and copying the text from it here:


This is already reported in upstream (see the link in Additional Information), however I am also reporting it in downstream since it can be considered as a possible security issue.

When a new app window is opened from shell overview, focus is in most cases not properly given to the new window and user input still goes to the old focused window. Both windows appear to be in focus, however, the old window has the proper focus.

This is a potential security issue that almost made me type my password and other sensitive data into Slack/IRC instead of terminal multiple times.

Reproducible: Sometimes

Steps to Reproduce:
1. Use latest, fully updated Fedora Workstation 38 system.
2. Open shell overview (super key).
3. Run the "Terminal" app either by using mouse or keyboard.
4. See if the newly opened window has focus.

Actual Results:  
See the attached screenshot. It happens very often.

In some apps (for example the new GNOME "Console" app), there is even no indication that the window does not have focus. (See the screencast in linked upstream ticket.)

Expected Results:  
The newly opened window has focus.

https://gitlab.gnome.org/GNOME/mutter/-/issues/2690

Comment 2 Daniel Rusek 2023-06-07 13:54:52 UTC
Created attachment 1969527 [details]
No focus on newly opened Terminal window

Comment 3 Daniel Rusek 2023-06-07 13:56:19 UTC
*** Bug 2210556 has been marked as a duplicate of this bug. ***

Comment 4 Daniel Rusek 2023-06-07 14:04:58 UTC
*** Bug 2192155 has been marked as a duplicate of this bug. ***

Comment 5 Daniel Rusek 2023-06-07 14:06:50 UTC
*** Bug 2190514 has been marked as a duplicate of this bug. ***

Comment 6 Daniel Rusek 2023-07-21 14:54:44 UTC
There is now a fix available for Wayland users:

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3105

It is currently waiting to be merged upstream.

Comment 7 Daniel Rusek 2023-08-07 10:00:49 UTC
The proposed fix from !3105 sadly did not get accepted:

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3105#note_1805643
https://gitlab.gnome.org/GNOME/mutter/-/issues/2690#note_1806257

Comment 8 Daniel Rusek 2023-08-17 11:14:10 UTC
There is now a correct fix for gnome-44 that will hopefully get merged soon (it already got merged into main/gnome-45):

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3186

Comment 9 Daniel Rusek 2023-08-30 12:22:34 UTC
The update that fixes this issue[1] is now in stable F38.

[1] https://bodhi.fedoraproject.org/updates/FEDORA-2023-2da9200945


Note You need to log in before you can comment on or make changes to this bug.