Switching to application with multiple windows alternates the target windows

Bug #796513 reported by Jan Nekvasil
70
This bug affects 23 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Undecided
Unassigned
Unity
Fix Released
High
Unassigned
unity (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: unity

Unity 3.8.14-0ubuntu1~natty1.

How to reproduce:

1) Open application with two windows (e.g. Nautilus with different folders: ~/Music, ~/Pictures).
2) Open another application (Calculator).
3) Switch back to first application by clicking on it's icon on the launcher.
4) Switch back to second application using the same method.
5) Switch back to first application using the same method.
6) Repeat ad lib.

Expected result: The last used first application's window will get activated and raised every time.
Actual result: Focus alternates between both first application's windows by each switch back to first application.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

I managed to reproduce this one successfully. Unity should highlight the window which was last focused.

Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Robert Roth (evfool)
Changed in unity (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Changed in unity:
status: Confirmed → Triaged
Revision history for this message
Jan Nekvasil (jan-nekvasil) wrote :

This bug is a regression. Unity in Natty live CD (3.8.10-0ubuntu2) is not affected by this bug; however downgrading unity to that version does not help. Maybe it's a compiz issue?

Revision history for this message
Michael Tänzer (neoatnhng) wrote :

I can confirm that it shows the behaviour described in the report in an up-to-date version of Ubuntu but not on the version as distributed on the live CD.

I tried to play around with downgrading packages an I could narrow it down to the packages compiz, compiz-core, compiz-gnome and compiz-plugins. Version 1:0.9.4+bzr20110415-0ubuntu2 of all of those packages works while 1:0.9.4+bzr20110606-0ubuntu1~natty2 does not. Unfortunately I couldn't downgrade them one at a time without breaking my setup to pin it down to one package

Revision history for this message
Michael Tänzer (neoatnhng) wrote :

I'd also like to see a higher priority for this because it's pretty annoying.

For example if you edit a new email in Thunderbird, then want to look something up in Firefox to include it in that email and then switch back to Thunderbird you're back in the main window instead of the edit window where you were before, you then have to click the Thunderbird icon again to activate the scale and then finally click the edit window to get back to where you started.

Of course you could also use Alt+Tab but if the lookup requires more stuff than just switching to Firefox that also becomes infeasible

Revision history for this message
Jan Nekvasil (jan-nekvasil) wrote :

"This bug affects you and 2 other people" - it's possible that most users aren't affected, or are they all even using only one window by each application? Oneiric Alpha 3 seem also affected to me, but nobody complains. Why?! This is core functionality issue, I simply can't understand why it's not gaining more attention...

Revision history for this message
Arun T (arunkumar-thondapu) wrote :

I see this issue on Ubuntu 11.04 with every application I use.
It is indeed annoying when you use windows in maximized mode because you end up performing actions in the wrong window.
For example, I launch multiple eclipse windows for development and when I switch from another application to eclipse by clicking on the unity launcher icon, the window that is brought to the foreground is different from the one that actually has focus.
The result is that none of the editor tabs have focus in the eclipse window that is visible and if I start typing inadvertently, the content goes into the wrong editor.

Revision history for this message
Jan Nekvasil (jan-nekvasil) wrote :

Now, with compiz 1:0.9.5.94+bzr2803-0ubuntu5 and unity 4.16.0-0ubuntu1, this bug suddenly appears in current Ubuntu 11.10 Oneiric too.

Revision history for this message
Jan Nekvasil (jan-nekvasil) wrote :

Apparently fixed in the package compiz - 1:0.9.5.94+bzr20110919-0ubuntu1.

Revision history for this message
Xavier Guillot (valeryan-24) wrote :

Problems of focus improved a lot with last Compiz / Unity updates, but one of them is still not fixed for me, when there are 2 windows of an application running, one maximized in the background, another which takes the foreground and is closed.

As explained in duplicate https://bugs.launchpad.net/ubuntu/+source/unity/+bug/813714

Ex: I run Gpodder, maximized, only one instance of the program, and launch the update verification.

During this time, I go back to Firefox by clicking on its icon on Unity dock, without minimizing Gpodder, and continue my surf.

Suddendly, Gpodder comes to the foreground with 2 windows : the first one, the maximized program, and another one on first plan which tells me there are updates available with options buttons (Cancel - Download) ; this window, which is not maximized on screen, has well the focus.

I click on "Download", updates are downloading, so the second window of Gpodder closes.

Logically, as it is the behavior in Unity, focus on the dock re-goes to the last application which had it before the new window took it, ie Firefox.

Problem : it is still the main Gpodder window maximized which appears in front of my screen. But of course, global menu is the one of Firefox and if I click on "close" button in order to close Gpodder, it's Firefow which disappears.

Again, I have to click anywhere on Gpodder window to re-focus it, and then close or click on Firefox icon.

This also occurs sometimes with Synaptic and widow of downloads, too.

I hope I'm clear, please see screenshot taken just after I clicked on "Download" on dialog window of Gpodder and after this one closed, focus is on Firefox (right arrow on dock), global menu is Firefox but on my screen, the main program I see maximized on foreground is Gpodder...

Changed in unity:
assignee: nobody → Sam Spilsbury (smspillaz)
milestone: none → 4.24.0
Changed in unity:
milestone: 4.24.0 → 4.26.0
importance: Undecided → High
Changed in hundredpapercuts:
status: New → Confirmed
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This is fixed in oneiric

Changed in unity (Ubuntu):
status: Triaged → Fix Committed
Changed in hundredpapercuts:
status: Confirmed → Fix Committed
Changed in unity:
status: Triaged → Fix Committed
assignee: Sam Spilsbury (smspillaz) → nobody
Changed in hundredpapercuts:
status: Fix Committed → Fix Released
Changed in unity (Ubuntu):
status: Fix Committed → Fix Released
Changed in unity:
status: Fix Committed → Fix Released
Revision history for this message
Xavier Guillot (valeryan-24) wrote :

I don't know if there is the same bug, as this one is marked fixed, but in Precise I still got the problem of good window focus when 2 instances of a program are opened but not focused, one of them is not maximized and the 2 come in foreground.

It happens with Gpodder, Synaptic, Update Manager, Thundebird and when something occurs which opens a new smlall window (podcast updates available, when Synaptic finished downloading and gebins installing, Lightning alert...).

Some examples and screenshots :

I run a program, ie Firefox, in a maximized window, triangle in the right side of Unity dock, which indicates the focused application, is well put on Firefox icon.

If, just before switching to Firefox, I've run Update Manager or Synaptic to download some packages, manually switched to Firefox, at the time downloads (or update verification) are finished and packages begin to install (or if there is a partial update available), Synaptic (or Update Manager) comes himself in foreground (without I click on its icon).

In Synaptic (which has its left triangle in Unity icon blue) I click to close the unmaximized update window, so it leaves normal Synaptic maximized window in foreground.

But the right triangle remains on Firefox icon, which has the focus. So, a click on Firefox icon to go back on Firefox does not do anything, as default behavior in Unity, when an application is selected, is that click on its icon does nothing.

So I have to manually click somewhere in the Synaptic window (to focus Synaptic) or to an icon other than Firefox to select this program, and again click to Firefox icon to come back to Firefox !

Other problem, global menu is the one from Firefox, and if I click on the left"X" icon to close Synaptic, it's Firefox which closes as it is focused...

But, with Synaptic in foreground, if I press "Imp Ecr" to do a printscreen, then "enter" to validate the saving, printscreen & confirmation window disappear, and then I'm well back to Firefox with focus, no more Synaptic in foreground...

These ones above are still bugs present.

But the following problem is well fixed and corrected :

- I have Firefox and Bookmarks manager opened, so 2 windows for Firefox, both maximized, and I'm on the navigation widow.

I open gedit, maximized, it appears on front and takes the focus, I write on it, let it opened and go back to Firefox navigation window with one left click to Firefox icon in Unity dock.

Here, if I minimize Firefox with the "-" button in global menu, I see on the screen the maximized window of Firefow Bookmark Manager, but the focus (and right triangle on dock), has gone to gedit.

If I click to gedit icon, nothing happens, which is normal, it has the focus. If I click on the Firefox icon or everywhere in the window of Bookmark Manager, focus goes back to Firefox Window Manager...

I hope it helps.

Revision history for this message
Xavier Guillot (valeryan-24) wrote :
Revision history for this message
Xavier Guillot (valeryan-24) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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