Gala: New windows sometimes open in the background

Created on 15 May 2017  路  44Comments  路  Source: elementary/gala

Excpected behavior: When I launch a second instance of an app I expect it to pop up to the foreground and take focus.
What happens instead: This behavior is not consistent.

Let's say you have your web browser open and then open a terminal (using Ctrl-Alt-T or whatever method). It opens to the foreground and takes focus as it should. Then when you open another terminal it also pops up to the foreground and takes focus. This behavior is expected, no complaints here, BUT here comes the bug:

While having your browser open (I use Firefox), open a terminal (which takes focus in the foreground as it should) and then put focus back to the browser and from there fire up a new terminal, it opens in the background (red bounch animation in the dock)! This is very annoying and can hardly be a feature?

This bug is also SOMETIMES present when having Firefox open and firing up Chromium. Sometimes Chromium pops to the foreground as it should, sometimes it doesn't. Don't have any more detailed info off the top of my head but can't seem to recall any other app pair behaving like this, at least often enough to annoy me.

Note: I have my dock on autohide (which doesn't seem to matter, I just reproduced the bug with "hide on maximize").

Summary:
open terminal -> open another terminal = WORKS (the second terminal takes focus)
open terminal -> open another app -> open another terminal = DOESN'T (the second terminal opens in background)

Launchpad Details: #LP1220179 oscarfroberg - 2013-09-03 11:00:29 +0000

Incomplete

Most helpful comment

Unfortunately this behavior was so annoying that I switched from eOS a week or two after posting this bug. The priorities of the dev team aren't exactly in order if they are working on new features for the next release instead of tweaking the current one that has huge bugs like these, which shouldn't even be hard to fix.

On the other hand, yes, they are a small team with limited resources, but I will not look forwards to nor can I recommend this or the next release to my Linux noob friends (or anyone else for that matter) if the quality of support for current releases is going to be like this.

By the way, is it known if this affects all users or just some?

Launchpad Details: #LPC oscarfroberg - 2014-01-06 13:05:48 +0000

All 44 comments

I installed gnome-terminal yesterday and set it as the default terminal, which made the problem go away. It would seem that the behavior is directly related to pantheon-terminal.

Launchpad Details: #LPC oscarfroberg - 2013-09-10 08:48:05 +0000

Problem is, that I can reproduce this bug with every app which can handle multiple windows and open them using shortcuts or other means. For example open Sublime Text 3, open a terminal and run subl -n ~/.bashrc. This opens a second window of sublime but does not pull it to the front. It just opens the window in the background. I like the idea and it would perhaps make sense in some ways, but by default its kind of annoying.

Launchpad Details: #LPC Oktay Acikalin - 2013-09-10 09:02:17 +0000

This bug happens with with every app. It is very annoying to open an app and have to click on it on plank.

Launchpad Details: #LPC Diego Castro - 2013-09-10 14:55:18 +0000

It also happens when restoring application from tray icon.

Launchpad Details: #LPC goroskob - 2013-09-10 15:14:48 +0000

Added a $50 bounty:

https://www.bountysource.com/issues/873476-new-windows-sometimes-open-in-the-background

Launchpad Details: #LPC Niclas 脜hd茅n - 2013-12-27 16:33:26 +0000

The user watching_cat added another $15 to the bounty making it $65.

Launchpad Details: #LPC Niclas 脜hd茅n - 2014-01-01 17:51:46 +0000

This issue also occurs with particular programs that switch to a running process when started. e.g. Transmission will stay minimized when it is started while already running.

Midori also shows strange behavior when started while minimized; It will bring the minimized instance to the foreground, then start a new browser window, and then minimize both browser windows.

Launchpad Details: #LPC Gabriel-LG - 2014-01-06 10:48:36 +0000

Unfortunately this behavior was so annoying that I switched from eOS a week or two after posting this bug. The priorities of the dev team aren't exactly in order if they are working on new features for the next release instead of tweaking the current one that has huge bugs like these, which shouldn't even be hard to fix.

On the other hand, yes, they are a small team with limited resources, but I will not look forwards to nor can I recommend this or the next release to my Linux noob friends (or anyone else for that matter) if the quality of support for current releases is going to be like this.

By the way, is it known if this affects all users or just some?

Launchpad Details: #LPC oscarfroberg - 2014-01-06 13:05:48 +0000

Sorry for your inconvenience. Unfortunately the source of this bug are very deep in gtk code, it's not actually related to gala. Thanks to the guys over at GNOME it looks like we got this fixed in gtk now or soon https://bugzilla.gnome.org/show_bug.cgi?id=721145 I'm still tesing this patch that has been linked most recently. Question is however, if we will be able to backport this patch. If not, maybe we can cheat and get gala to override the behavior, but at the moment I'm very busy. I really hope I'll be able to get back on this the coming weekend, it already took me quite some time to figure out where the problem actually came from.

Launchpad Details: #LPC Tom Beckmann - 2014-01-06 16:04:45 +0000

Thanks Tom, it's really great that you're working on it.

Launchpad Details: #LPC Niclas 脜hd茅n - 2014-01-07 17:24:52 +0000

Just FYI, this bug is still present on freya-beta1 with GTK 3.12.2. Will this bug be targeted for freya?

Launchpad Details: #LPC marianitn - 2014-09-19 14:12:26 +0000

This issue may be the root cause of https://bugs.launchpad.net/noise/+bug/1301952.
The noise bug must be retested once this issue is fixed.

Launchpad Details: #LPC PerfectCarl - 2014-10-18 18:31:26 +0000

Tom, do you mind knocking at the GNOME peoples door again? I don't understand why the bug report over there has been marked as resolved and invalid...

Launchpad Details: #LPC Oktay Acikalin - 2014-10-18 18:56:07 +0000

I can recreate this error with all applications.

Step 1: Maximize a window.
Step 2: Minimize a different window.
Step 3: Open a window of the same grouping that is currently minimized.

The new window will open minimized.
The desired action is the new window opening to the very front, on top of the maximized window.

Launchpad Details: #LPC Brandon Taylor - 2014-11-14 22:10:14 +0000

Just to make reproducing steps more accurate:

Step 1: Maximize a window.
Step 2: Minimize a different window.(make sure it's not maximized first -> unmaximize it first)
Step 3: Open a window of the same grouping that is currently minimized.

The new window will open minimized.
The desired action is the new window opening to the very front, on top of the maximized window.

Launchpad Details: #LPC Ash - 2015-02-14 03:40:55 +0000

I can confirm this issue.

For example, if I click on an email address (mailto link) in Chromium, then my Thunderbird compose window opens behind Chromium but not in the foreground. I believe this is not the desired behaviour.

Something similar is happening with Terminal windows. They sometimes open in the very background and I have to use Super + W to find them.

I am using Freya Beta 2 with the latest installed updates from unstable.

Launchpad Details: #LPC Robert Orzanna - 2015-03-10 07:47:13 +0000

I can confirm this too. Most apps always opens in background. Usually I have chromium running maximized. When I need to access file manager, terminal, skype or other apps from plank, they mostly open in background and then I have click respective icon again to bring the app to foreground.

Launchpad Details: #LPC Ruchir - 2015-04-30 04:55:04 +0000

(freya stable) I have a similar error:
When I download a thing in chrome and I click on "show in folder" it'll open the window/tab in background, so I get a red dot under Files icon in Plank and only if I open it I can see the file.

I guess that is related to this two too:
1.(When Files is opened but it's minimized) Click with the right button of the mouse on Files > "new tab". This time I don't get a red dot but it'll open the new tab again in backgrond
2.(When Files is opened but it's minimized) Click with the right button of the mouse on System Settings > click on one of the things available (for example let's say "personal" > "application") again, It'll open in background the "application" tab but in background!

Launchpad Details: #LPC roberto - 2015-05-04 11:49:09 +0000

In the previous comment at the "2." point I wanted to write -> (when System Settings is opened but it's minimized)

Launchpad Details: #LPC roberto - 2015-05-04 11:50:50 +0000

Can confirm this is still happening, on a fresh install. I saw that the bug in GTK was fixed in the remote bug tracker, any idea when we will get the fix?

Launchpad Details: #LPC Xander - 2015-05-12 20:07:55 +0000

This bug is really annoying - anything we can do to get this fix in elementary? Contributed to the bounty on this, in case that helps.

Launchpad Details: #LPC Espen Hovlandsdal - 2015-06-15 18:26:27 +0000

I still have this bug with the Screenshot app and Chromium.

Launchpad Details: #LPC davidak - 2015-06-17 15:28:29 +0000

I can't believe this is still open, it's been two years since the original bug report. I can confirm Chromium is still affected by this issue, as it's the reason I came here in the first place.

Launchpad Details: #LPC Dave - 2015-07-05 16:10:00 +0000

Hi. I'm the developer of mutter. Can anybody give me concrete steps to reproduce this issue? I tried the terminal shortcut steps above and it worked fine.

I unfortunately can't test on actual Elementary OS, but I can see if the same steps break on upstream mutter or GNOME. If they don't, it might be fixed in the latest upstream mutter, and would be fixed by a rebase to mutter 3.16.

Launchpad Details: #LPC Jasper St. Pierre - 2015-07-05 19:29:05 +0000

Managed to reproduce this. Ugh. It's a complicated issue going back for years.

The best technical explanation I can find is https://bugzilla.gnome.org/show_bug.cgi?id=149028#c32

I'll talk to Owen, Ryan and Alex about this on Monday to see if we can come up with some ideas about this. Perhaps "any windows launched from within a GtkApplication command_line / open / activate handler shouldn't get a global user timestamp" is acceptable.

Launchpad Details: #LPC Jasper St. Pierre - 2015-07-05 23:34:30 +0000

A new bug and temporary patches have been filed at https://bugzilla.gnome.org/show_bug.cgi?id=752000

Launchpad Details: #LPC Jasper St. Pierre - 2015-07-06 00:07:11 +0000

Thank you for looking into this ! Don't forget to remind them about the bounty, it is currently at $100 on bountysource ! ;-)

Launchpad Details: #LPC Dave - 2015-07-06 12:30:20 +0000

Hi all. I don't know if this 'solves' the issue, but worked for me:

http://askubuntu.com/questions/310470/newly-opened-applications-open-in-background

Maybe it can help you with a true solution.

Cheers,
L.

Launchpad Details: #LPC Luke Berner - 2015-07-06 13:52:56 +0000

The GTK+ side of the bug has been fixed. This does not guarantee that all cases of this are fixed, simply that the one that I investigated: Chromium launching other apps.

If you guys are still seeing this after the GTK+ patch has landed, please give me a set of step-by-step instructions to reproduce it.

Launchpad Details: #LPC Jasper St. Pierre - 2015-07-15 01:36:48 +0000

Hello everybody.

It's been more than 2 years since this bug was reported and I can confirm it still persists. I have elementary OS 0.3.1 Freya (64-bit), and almost every time I open Geary from Plank or the notification area while other program is maximized and focused (I tried with Chrome, Wolfram Mathematica, Pantheon Files and many others), it opens in background. Same thing when trying to open Spotify from tray.

The funny thing is that when Geary wasn't maximized on last execution, it launches on foreground even with other programs maximized and focused.

Any ideas on how to fix that?

Launchpad Details: #LPC Adri谩n Carre帽o - 2015-11-25 20:04:02 +0000

This issue still manifests in Loki.

Launchpad Details: #LPC Zisu Andrei - 2016-03-16 17:23:58 +0000

I can also confirm it still occurs on Elementary 0.3.2
Reproduction is simple

  1. Using Pantheon terminal
  2. start terminal
  3. run gedit
  4. focus some other window
  5. start another tab or window of the terminal
  6. run gedit
    it opens a new tab but does not focus the gedit app

(if you however run gedit from the Applications menu it works)

  1. Using Applications menu and Chrome
  2. start Chrome from Applications menu
  3. focus another window
  4. start Chrome again
    the new window stays in the background

I love elementary but this is becoming really serious
Thank you

Launchpad Details: #LPC Jakub Klos - 2016-03-23 09:30:13 +0000

Does Loki+1 mean this has been triaged?

Launchpad Details: #LPC m - 2016-05-08 21:47:48 +0000

Running the new Loki release and the problem exists.

But I have only reproduced the problem with the App center and Pantheon Terminal.
Basically if you have another window open before you open the pantheon-terminal or app center
the focus is still on the previously open window/application.
However if there are no other windows/apps open or if all other windows are minimized to Plank the focus works.

Launchpad Details: #LPC Artemis Entreri - 2016-09-10 08:09:47 +0000

I can't reproduce any of these scenarios on Loki 0.4 (x64).

  1. Open Terminal (Super + T).
  2. Focus on another window.
  3. Open another Terminal (Super + T)
    = Second Terminal window opens in foreground.

  4. Open Terminal (Super + T).

  5. Run gedit.
  6. Focus on another window.
  7. Open new Terminal window or add new tab to existing Terminal window.
  8. Run gedit.
    = New tab in gedit opens, and gedit is brought to foreground.

I've reproduced these and all the others on this page, but none of them result the same behavior. Bug fixed?

Launchpad Details: #LPC Joshua Niesler - 2016-11-27 02:48:40 +0000

Sometimes newly launched apps are not in focus after launching.

It doesn't always happen but when it does, the app that is just launched is not brought into focus for input. This means for example, in AppCenter, launching it and starting to search doesn't work.

It can only be tested by setting up hot corners. Say set top right as "Maximize current Windows", then launch Photos app and try to move cursor to top right. The window in the background is maximized/unmaximized instead.

Is this still an issue in Juno? I don't think I've experienced it lately, and it may have been fixed by a Mutter change.

@cassidyjames Can confirm I have never seen the issue in juno.

Gonna close this as "incomplete" and we can investigate if we experience issues again

I got this issue again on Juno !

@edimitchel can you describe the circumstances around your seeing the issue?

For pop up in Chrome that I opened, they always pop in background. I need to use my scroll roll on the chrome icon to set the popup on front !
It appends too on clicking on my notifications : Discord, Slack, etc..

I have this issue too. It's extremely annoying when you're using Steam in Big Picture Mode.

Steps to reproduce:

  1. Open Steam, set it to big picture mode
  2. Launch a game, this will sometimes already trigger the bug. Steam will minimize and the game won't receive focus.
  3. Close the game, Steam will have a red dot on planck, but won't receive focus nor go into fullscreen mode.

When using Steam in a Steam Home Streaming it's virtually impossible to get back into Steam without getting up, walking over to the computer and clicking on Steam or the game to give it focus. Which is a bit annoying.

Confirming the same issue.
New opened apps open in background instead of foreground.
Cannot tell after witch update it started.
Had no problem for few months after installing Juno fresh.
Screen record from 2019-09-02 20 50 08

My system:

System:    Host: elementary-os Kernel: 4.15.0-55-generic x86_64 bits: 64 gcc: 7.4.0
           Desktop: Gnome  (Gtk 3.22.30) Distro: elementary OS 5.0 Juno
Machine:   Device: desktop Mobo: ASUSTeK model: Z170-DELUXE v: Rev 1.xx serial: N/A
           UEFI: American Megatrends v: 3504 date: 06/29/2017
CPU:       Quad core Intel Core i7-6700K (-MT-MCP-) arch: Skylake-S rev.3 cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 32064
           clock speeds: max: 4300 MHz 1: 3651 MHz 2: 3769 MHz 3: 2882 MHz 4: 3454 MHz 5: 3491 MHz 6: 3417 MHz
           7: 3525 MHz 8: 3492 MHz
Graphics:  Card: NVIDIA GP104 [GeForce GTX 1080] bus-ID: 01:00.0
           Display Server: x11 (X.Org 1.19.6 ) driver: nvidia Resolution: [email protected]
           OpenGL: renderer: GeForce GTX 1080/PCIe/SSE2 version: 4.6.0 NVIDIA 430.40 Direct Render: Yes
Audio:     Card-1 Intel 100 Series/C230 Series Family HD Audio Controller driver: snd_hda_intel bus-ID: 00:1f.3
           Card-2 NVIDIA GP104 High Definition Audio Controller driver: snd_hda_intel bus-ID: 01:00.1
           Sound: Advanced Linux Sound Architecture v: k4.15.0-55-generic
Network:   Card-1: Intel Ethernet Connection (2) I219-V driver: e1000e v: 3.2.6-k bus-ID: 00:1f.6
           IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter>
           Card-2: Broadcom and subsidiaries BCM4360 802.11ac Wireless Network Adapter
           driver: bcma-pci-bridge bus-ID: 07:00.0
           IF: N/A state: N/A mac: N/A
           Card-3: Intel I211 Gigabit Network Connection driver: igb v: 5.4.0-k port: c000 bus-ID: 0b:00.0
           IF: enp11s0 state: down mac: <filter>
Drives:    HDD Total Size: 2690.6GB (3.8% used)
           ID-1: /dev/nvme0n1 model: PCIe_SSD size: 120.0GB
           ID-2: /dev/sda model: Samsung_SSD_850 size: 256.1GB
           ID-3: /dev/sdc model: Crucial_CT1050MX size: 1050.2GB
           ID-4: /dev/sdd model: KINGSTON_SH100S3 size: 120.0GB
           ID-5: /dev/sdb model: Samsung_SSD_850 size: 1024.2GB
           ID-6: /dev/sde model: KINGSTON_SV300S3 size: 120.0GB
Partition: ID-1: / size: 110G used: 97G (93%) fs: ext4 dev: /dev/sde1
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 35.0C mobo: N/A gpu: 0.0:54C
           Fan Speeds (in rpm): cpu: 0
Info:      Processes: 271 Uptime: 9 min Memory: 1933.1/64357.1MB Init: systemd runlevel: 5 Gcc sys: 7.4.0
           Client: Shell (bash 4.4.201) inxi: 2.3.56
Was this page helpful?
0 / 5 - 0 ratings

Related issues

peteruithoven picture peteruithoven  路  3Comments

danrabbit picture danrabbit  路  4Comments

hanaral picture hanaral  路  4Comments

hanaral picture hanaral  路  3Comments

marbetschar picture marbetschar  路  4Comments