(In Xorg sessions only) apps launched from gnome shell do not get input focus

Bug #1817924 reported by Rachel Greenham on 2019-02-27
This bug affects 26 people
Affects Status Importance Assigned to Milestone
Fix Released
mutter (Ubuntu)
Daniel van Vugt
Daniel van Vugt

Bug Description

Observed on upgrading to disco-proposed today...

When launching an app from the dock or from the applications grid (so i believe it's a gnome-shell thing rather than a dock thing), the app opens, but does not get the input focus. You have to either click in the window, or clicking again on the icon of the running app in the dock works, to give it focus. An extra step my muscle memory isn't prepared for!

It seems like the sort of thing that might be an option rather than a bug, but if so, changing this behaviour back to its previous default is not at all obvious (I haven't found a way). So guessing it is a bug. NB: After launching an app this way, *no* window has focus. It is lost by the app that had it before, but not given to the newly started app.

ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: gnome-shell 3.31.90-1ubuntu1
ProcVersionSignature: Ubuntu 4.19.0-13.14-generic 4.19.20
Uname: Linux 4.19.0-13-generic x86_64
ApportVersion: 2.20.10-0ubuntu21
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Feb 27 15:53:07 2019
DisplayManager: gdm3
InstallationDate: Installed on 2018-09-11 (169 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180214)
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to disco on 2019-01-13 (44 days ago)

Related branches

NB: If you launch an app from a terminal, eg: gnome-calculator, it *does* then get the input focus; just not when launched from gnome-shell. That's why I didn't think it was a mutter bug.

Daniel van Vugt (vanvugt) wrote :


I can't find any existing reports of this problem in Launchpad or upstream. So please report the bug to the Gnome developers here:


and then tell us the new issue ID.

Daniel van Vugt (vanvugt) wrote :

But before you report the problem upstream, please try uninstalling your extensions:

b'org.gnome.shell' b'enabled-extensions' b"['<email address hidden>', '<email address hidden>', '<email address hidden>', '<email address hidden>', 'suspend-button@laserb', '<email address hidden>', '<email address hidden>', '<email address hidden>']"

and then verify the problem still happens.

Changed in gnome-shell (Ubuntu):
status: New → Incomplete

FYI problem remains with all those extensions removed.

BTW one does tend to notice it most with apps you type into. I first noticed with terminal, where I'm used to click, then start typing, and it's suddenly become click, click-again, then start typing. With an app you'd tend first to click into anyway, you're more likely to not notice it as the first click in an unfocused window is passed in.

(Along the way, minor invisible-to-user bug in that the setting org.gnome.shell.enabled-extensions retains entries for extensions that have been removed. Noticed first because I already didn't have dash-to-dock installed, but did until recently - when without -proposed enabled, the ubuntu dock extension stopped working (works again with -proposed enabled, i think the latest non-proposed version of ubuntu-dock secretly depends on the proposed gnome shell). Confirmed as all those listed extensions remained in that setting after removing all of them. I've just reset it to default value, empty array.)

Sebastien Bacher (seb128) wrote :

Not confirming here, with gedit added to the launcher, click on gedit, wait for the editor to open and typing does correctly input in the text widget

confirmed, gedit seems to be immune for some reason. pretty much anything else i tried is not; calculator, terminal, libreoffice, nautilus...

sublime text, slack also immune, firefox, thunderbird are not... so ok it's not universal but *lots* of apps are affected, and the pattern doesn't seem to be gnome/not-gnome.

Sebastien Bacher (seb128) wrote :

Weird, command line do get the focus here, the right thing to do would probably to report upstream in any case. Do you wait for the dialog to be displayed before starting to type or do you hit the keyboard while it's loading?

it's not generally slow enough for the latter to be an issue. :-) Even
if I just go nice and slow. Click... window opens... it doesn't have
focus... It continues to not have focus until I do something that would
give it focus in the normal fashion, like clicking on it, clicking on
its dock icon now it's running, alt-tabbing to it...

Is this not happening for you in launching gnome-terminal? It's same for
me whether from dock, from app grid, from app grid's search field.
*Sometimes* it's been slow enough that I think I've seen the window have
focus for a tiny moment (the close-window icon in the titlebar is orange
for a moment) then it gets taken away. Usually it's too fast to see that
happen. BTW I've also tried it with *all* extensions removed, including
ubuntu-dock and appindicators and desktop-icons, by removing their
packages. No difference.

Bug only affects X11 sessions.

I had a random urge to try out Wayland again. This issue does not arise in Wayland. Apps that were affected under X11 are taking input focus quite happily when launched from shell in Wayland.

bwat47 (bwat47) wrote :

I can re-create this 100% of the time launching gnome terminal in ubuntu 19.04 (with all updates installed as of this comment).

hit super key

search for 'terminal'

hit enter

gnome terminal opens, but un-focused.

This does not happen in ubuntu 18.10

bwat47 (bwat47) wrote :

Also, this is a fresh ubuntu 19.04 install from the daily ISO as of a few days ago. There have been 0 modifications to settings or installed software

i didn't freshly install to see it but i did create a new user, to be sure I had utterly default settings and yes, it's there right from the get-go with certain apps including terminal. but only in x11 (which of course *is* still the default in ubuntu). I switched to wayland and this problem went away. The remaining issues in wayland have proved insufficient to push me back to x11, so I've been able to stop caring about this. :-)

I guess people just aren't testing for x11 thoroughly any more.

bwat47 (bwat47) wrote :

I can also confirm, as rachel saw:

- This also happens with all gnome extensions disabled. I tested with the 'vanilla' gnome session.
- This does not happen under wayland
- Certain apps (e.g. Gedit), aren't effected.

Further to that, I also found that this only seems to happen in the first workspace. If I open some application in the first workspace, switch to a second workspace, and open gnome-terminal there, it does get focus.

I entered an upstream bug report: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1043

tags: added: rls-dd-incoming
Changed in gnome-shell:
status: Unknown → New
Changed in gnome-shell:
status: New → Fix Released
bwat47 (bwat47) on 2019-03-17
Changed in gnome-shell:
status: Fix Released → Unknown
Changed in gnome-shell:
status: Unknown → New
Changed in gnome-shell (Ubuntu):
importance: Undecided → High
status: Incomplete → Confirmed
Will Cooke (willcooke) on 2019-03-19
tags: added: rls-dd-tracking
removed: rls-dd-incoming
Changed in gnome-shell (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-shell:
status: New → Fix Released
Changed in gnome-shell:
status: Fix Released → Unknown
Changed in gnome-shell (Ubuntu):
status: Confirmed → Triaged
Changed in gnome-shell:
status: Unknown → New
bwat47 (bwat47) on 2019-03-27
Changed in gnome-shell:
status: New → Unknown
Changed in gnome-shell:
status: Unknown → New
affects: gnome-shell → mutter
Changed in mutter (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in mutter (Ubuntu Disco):
assignee: nobody → Daniel van Vugt (vanvugt)
summary: - apps launched from gnome shell do not get input focus
+ (In Xorg sessions only) apps launched from gnome shell do not get input
+ focus
Changed in mutter (Ubuntu Disco):
status: Triaged → In Progress
no longer affects: gnome-shell (Ubuntu)
no longer affects: gnome-shell (Ubuntu Disco)
tags: added: fixed-in-3.32.1 fixed-upstream
Changed in mutter:
status: New → Fix Released
Changed in mutter (Ubuntu Disco):
status: In Progress → Triaged

I launch terminal right clicking on desktop and selecting 'open in terminal' terminal get focus.
launch terminal from the dock terminal does NOT get focus.
orrado@corrado-p5-dd-0403:~$ inxi -S
  Host: corrado-p5-dd-0403 Kernel: 5.0.0-8-generic x86_64 bits: 64
  Desktop: Gnome 3.32.0 Distro: Ubuntu 19.04 (Disco Dingo)

Daniel van Vugt (vanvugt) wrote :

Fix committed via Debian:

mutter (3.32.0+git20190410-1) experimental; urgency=medium

Changed in mutter (Ubuntu Disco):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.32.0+git20190410-1ubuntu1

mutter (3.32.0+git20190410-1ubuntu1) disco; urgency=medium

  * Merge with debian git snapshot (LP: #1820542), remaining changes:
    + debian/control:
      - Update VCS flags to point to launchpad
      - Update maintainer to ubuntu
    + debian/gbp.conf: update branch to point to ubuntu/master
    + debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
      - X11: Add support for fractional scaling using Randr
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Refreshed.

 -- Marco Trevisan (Treviño) <email address hidden> Wed, 10 Apr 2019 20:12:29 -0500

Changed in mutter (Ubuntu Disco):
status: Fix Committed → Fix Released
Silvio Bierman (sbierman) wrote :

This bug also occurs in Wayland on a fresh Disco install. Opening Nautilus, Chromium, GEdit etc. does not properly set the focus to the newly opened windows.

I have the mutter version that should contain the fix:

root@mizuno:~# apt show mutter
Package: mutter
Version: 3.32.0+git20190410-1ubuntu1

so the fix does not seem to work on Wayland.

Silvio Bierman (sbierman) wrote :

I can now confirm it works in an X session though. So that part is fixed (although I never observed the bug there since I don't normally use X sessions).

Daniel van Vugt (vanvugt) wrote :

Wayland uses a different code path, so if you have any problems there then please open a new bug by running:

   ubuntu-bug gnome-shell


   ubuntu-bug mutter

Silvio Bierman (sbierman) wrote :

Since the bug seemed to have appeared in both environments at the same time I was not expecting two separate bugs. I have opened a new one against Gnome session: bug 1826176.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.