Clicking notification panel icon doesn't switch desktops

Bug #207744 reported by Iain Lane on 2008-03-27
14
Affects Status Importance Assigned to Milestone
Gaim
Invalid
Unknown
Metacity
Fix Released
Medium
Pidgin
Invalid
Unknown
metacity (Fedora)
Won't Fix
High
metacity (Ubuntu)
Low
Ubuntu Desktop Bugs
pidgin (Fedora)
Won't Fix
Low
pidgin (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: pidgin

laney@chicken:~$ lsb_release -rd
Description: Ubuntu hardy (development branch)
Release: 8.04

laney@chicken:~$ apt-cache policy pidgin
pidgin:
  Installed: 1:2.3.1-2ubuntu1
  Candidate: 1:2.3.1-2ubuntu1
  Version table:
 *** 1:2.3.1-2ubuntu1 0
        800 http://archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

When a message is received in Pidgin, the notification area icon flashes as expected. Clicking this icon in Gutsy always used to switch to the desktop with the IM window on and activate it. Clicking it now only shows the IM window in the window list. It does not switch to the desktop with it on, nor does it cancel the unread status.

Steps to repro:

1. Start a conversation with somebody
2. Switch to another desktop
3. When a message is received and the notification area icon is flashing, click it
4. The desktop is not switched to the one with the IM window, but the IM window now appears in window list.

Expected behaviour:

At 4, the desktop should switch and activate the IM window.

This is a regression from Gutsy.

Description of problem:

When I open a new tab (via right click on a terminal, clicking on something in
liferea, whatever), firefox immediately jumps onto the current workspace.

This is irritating.

Version-Release number of selected component (if applicable):

firefox-2.0.0.6-11.fc8

Additional info:

Seems related to the startup notification patch, as it worked ok in 2.0.0.6-8.fc8.

I will second this. Very irritating!

Owen says this is a metacity bug. The following program also hops windows.

#!/bin/env python

import gtk
import gobject
w = gtk.Window()
w.set_title("Foo")
w.show()

def on_timeout():
        w.present()
        return False

gobject.timeout_add(5000, on_timeout)
gtk.main()

er, hops workspaces

To give some background on this issue, Firefox now supports startup notification:
https://bugzilla.mozilla.org/show_bug.cgi?id=223492

The issue in this bug only occurs when there are multiple workspaces.

Removing this Firefox patch would be a regression in the single workspace case
because it would require clicking on a flashing browser entry in the task list
after activating an external link.

From IRC:

<owen> walters: metacity could look at the window role and alter the behavior
based on that

FWIW, commenting out the call to gdk_window_focus() in the patch makes it DTRT
for me.

Actually, what I meant was that based on the "type" of the window application
vs. dialog, you could do different things.

A application never, under any circumstances, should be moved between desktops.

Bill, what effect does that have in the single-workspace case?

Also, I've filed this bug upstream here:

http://bugzilla.gnome.org/show_bug.cgi?id=482354

Since there seems to be agreement this is an upstream Metacity issue, please
continue discussion there.

Colin: when it's on the same workspace, I get the throbbing entry in the panel.
When it's on the other workspace, I don't.

We need to fix this for F8...

This is also happening in compiz... so more than just metacity at work here.

Jeremy: not quite...

in metacity, the _window_ switches to the current workspace.

In compiz, the _active workspace_ switches.

This is about the metacity issue, which everyone agrees is clearly wrong. The
compiz behavior seems more or less sane. While different, i've already gotten
used to it.

The long discussion leading to the current metacity behaviour can be found
here: http://bugzilla.gnome.org/show_bug.cgi?id=166379

So, going back to the beginning. The original patch (for firefox) has the
following comments usptream from Elijah
(https://bugzilla.mozilla.org/show_bug.cgi?id=223492#c31):

************
>+ if (desktopStartupID.IsEmpty()) {
>+ PRUint32 timestamp = GTKToolkit->GetFocusTimestamp();
>+ if (timestamp) {
>+ gdk_window_focus(aWindow->window, timestamp);
>+ GTKToolkit->SetFocusTimestamp(0);
>+ }
>+ return;
>+ }

This block of SetUserTimeAndStartupIDForActivatedWindow() is a little
confusing. It doesn't set the user time or the startup id for the activated
window. Instead, it sends an "activate me, please" message to the window
manager. I understand it's just a workaround when no startup id is available
(because either firefox wasn't launched with startup-notification or wasn't
built with MOZ_ENABLE_STARTUP_NOTIFICATION), but it'd be nice to have it
documented as such. It'd also be good to verify in testing that this block of
code isn't being executed (i.e. that startup id is non-empty), since it is just
a workaround.
*****************

I find it odd that the supposed 'workaround' part of the code is what's causing
the problem in my testing.

Created attachment 225081
partial fix for firefox

Note that due to missing changes to the configury, we aren't even *building*
the SN support at the moment - this patch fixes that.

Doesn't change the behavior, though.

"This is not a blocker"

<notting> halfline: why not just take the patch out of ff, since we're not even
applying it in a way that works
<juhp> notting: exactly
<halfline> notting: that's not a horrible idea
 notting: might be worth talking to stransky about
 or caillon if he pops on

*** Bug 337721 has been marked as a duplicate of this bug. ***

Note there is now a patch for metacity upstream at:
http://bugzilla.gnome.org/show_bug.cgi?id=482354#c2

Also in response to:

<notting> halfline: why not just take the patch out of ff, since we're not even
applying it in a way that works

The patch does function as expected in the single workspace case, even if it may
be entering into a fallback section of the code (will investigate).

I have built a new version of metacity with the patch:
http://koji.fedoraproject.org/koji/buildinfo?buildID=21629

Please test, if it works well then we can reable to re-enable the Firefox fix.

(In reply to comment #20)
> Also in response to:
>
> <notting> halfline: why not just take the patch out of ff, since we're not even
> applying it in a way that works
>
> The patch does function as expected in the single workspace case, even if it may
> be entering into a fallback section of the code (will investigate).

The patch adds configury for using libstartupnotification, and ifdef'd code to
use libsn. We then build moz without sn support. If it's functioning, it's
completely by accident.

(In reply to comment #21)
> I have built a new version of metacity with the patch:
> http://koji.fedoraproject.org/koji/buildinfo?buildID=21629
>
> Please test, if it works well then we can reable to re-enable the Firefox fix.

Thanks, Colin! Yes, that works well for me so far. :)

(In reply to comment #22)
>
> The patch adds configury for using libstartupnotification, and ifdef'd code to
> use libsn. We then build moz without sn support. If it's functioning, it's
> completely by accident.

Ok, I'm at home so I can't actually test this with my rawhide computer, but from
looking at the patch again, the section you identified earlier (which calls
gdk_window_focus which ultimately causes the focus event) is the source of the
behavior under discussion.

The startup notification specification if supported correctly would make Firefox
display a progress status on first launch, but this (to me) is not the most
useful part of the patch. The most useful part is the behavior that when one
clicks on a link in an external program, the web browser appears and displays
the link.

Some people feel that behavior wasn't right for multiple desktops (and the
metacity patch addresses this), but please when testing things, try the single
workspace case. The expected behavior is that the browser appears; it should
not pulse as in comment #9. This is the way clicking on links works on other
platforms, and is the most sensible thing I believe for most situations in the
single-workspace case.

There might be some more special cases such as feed readers (liferea?) where one
wants to click a number of links to "queue" urls; I am open to discussion around
those. Probably the right solution for them will be to have the ability at
link-click time whether or not you want to see it.

I meant to mention above; the reason the patch still has effect is because the
gdk_window_focus call is outside the #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION.

Also, bear in mind this patch is already upstreamed and will be in the Firefox 3
release; I am not yet sure whether it will be in the 2.0.0.7 stream.

We'll probably want this metacity fix for FC7 too before Firefox's support makes
it there.

Fixed in F8, moving off blocker

Its fixed for me after last update in F8
Cheers

Description of problem:

With this patch (metacity-firefox-workaround-2.patch) the used behaviour of
pidgin when clicking on the tray icon changed/broke.

Up until this patch it was possible to click on the tray icon of pidgin and no
matter on which workspace this is done the buddy list appears on that workspace.

Now if clicking the tray icon the buddy list just disappears on the workspace it
is displayed and clicking it again lets it appear on the other workspace.

From my point of view this is a regression in the usability of my usage of the
whole desktop.

Version-Release number of selected component (if applicable):

metacity-2.20.0-3.fc8

I confirm this behaviour and also think this is a regression.

Same thing with liferea and its behavior on clicking the notification icon.

CCing Colin, who did that patch

What's happening here is that the Pidgin buddy list feels very similar to a menu
popup, but is actually implemented as a regular window. Pidgin seems to be one
of the few applications where the application relied on the behavior of
gtk_window_present() bringing windows to the current workspace.

On Compiz it seems to have the same behavior, which is interesting, because
before Compiz and Metacity differed on the gtk_window_present(), so there must
be some Pidgin-specific differentiation occuring somehow.

Anyways, since the Firefox patch was removed before Fedora 8, there isn't much
point to having this patch in Fedora 8 either. I will remove it and add an update.

We will figure out how to fix Firefox and Metacity together for Fedora 9, and
update them in sync.

This sounds like pidgin is trying to use _NET_ACTIVE_WINDOW as a hack to
simulate "launching" the buddy window? It could just launch it and then we know
to move it to the right workspace...

Iain Lane (laney) on 2008-03-28
description: updated
Pedro Fragoso (ember) wrote :

Have you tried to reproduce this on pidgin 2.4 ?

pidgin:
  Installed: 1:2.4.0-1ubuntu1
  Candidate: 1:2.4.0-1ubuntu1
  Version table:
 *** 1:2.4.0-1ubuntu1 0
        500 http://archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

Iain Lane (laney) wrote :

Yes, I just did and it's still there. I'm wondering whether this is a problem in GNOME/Compiz, however; from reading this: http://developer.pidgin.im/ticket/2968

For the record pidgin has no policy decisions on what should or shouldn't
happen when the use clicks the tray icon. All pidgin wants is that the buddy
list window be presented to the user as such using gtk_window_present is the
correct thing for us to be doing. Any policy decisions on what that means for
pidgin are squarely in the realm of the window manager, desktop environment,
and user preference. So again, pidgin itself relies on no specific behaviour
out of gtk_window_present other than that of 'presenting the window to the
user'.

Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Nicholas J Kreucher (kreucher) wrote :

Similar here...

Now, in hardy, clicking on the icon doesn't move pidgin to the current desktop nor does it switch to the desktop pidgin is on (as the previous poster noted). Same for buddy list or flashing icon to show chat window.

So, to find a new message in an existing chat window, I now have to manually switch to the desktop the chat window is on; same for the buddy list. Quite annoying and frustrating :(

Seems to be a side effect of an Ubuntu added patch to metacity: 011_gnome_482354_attachment_104591.patch ... see: http://bugzilla.gnome.org/show_bug.cgi?id=482354#c46

Also, this got filtered to Pidgin's own tickets, in a bit of a heated argument:
http://developer.pidgin.im/ticket/5521

IMHO, the patch was a mistake, but not everyone will agree :)

To recompile metacity w/o the patch:
$ sudo apt-get install build-essential devscripts fakeroot
$ sudo apt-get build-dep metacity
$ apt-get source metacity
$ cd metacity-2.*/debian/patches
$ rm 011_gnome_482354_attachment_104591.patch
$ cd ../..
$ debchange --nmu "remove 011_gnome_482354_attachment_104591.patch"
$ dpkg-buildpackage -b -us -uc -rfakeroot
$ cd ..
$ sudo dpkg -i metacity*.deb

Restart GNOME, and volla, pidgin window focusing and workspace switching works again.

Changed in metacity:
status: Unknown → Confirmed
Changed in gaim:
status: Unknown → Fix Released
Changed in pidgin:
status: Unknown → Fix Released
Nicholas J Kreucher (kreucher) wrote :

Another option is to patch Pidgin to hack around the changes made to metacity... Pidgin bug 5521, above, has an example patch on how to do this with the Buddy List (assume a similar patch is needed for the chat window).

I think if Ubuntu keeps the metacity patch intact, it should then patch Pidgin to avoid this regression.

Iain Lane (laney) wrote :

FWIW, since the Ubuntu patch was released I've just modified my behaviour to click on the pulsing entry in the task bar instead of the tray icon. I agree with the arguments on the Pidgin bug about not fighting the DE, and it not really being an issue with Pidgin per se.

I guess what we want is for Metacity to provide for applications to say "Yes, I really do want to warp workspace/move my window here", which Pidgin could then implement/pref as necessary. For my particular use case - switching when someone messages me - I'm pacified by the patch as is to not consider this a major usability issue.

That's not to say that I don't see the value in modifying Metacity. Often I want to click on a tray icon to (say) switch to Rhythmbox which is up in another workspace, but this doesn't work, as an irritating side-effect of this patch. The current behaviour is OK, but IMHO it should only last for as long as absolutely necessary until a better solution can be found.

Thank you for the bug report. Closing bug as per comment #27 and comment #28.

If you still experience this problem after updating to our latest Fedora
release, reopen this bug against that version if this bug exists there.

Changed in metacity:
status: Unknown → Invalid
Changed in pidgin:
status: Unknown → In Progress
Changed in gaim:
status: Fix Released → Invalid
Changed in pidgin:
status: Fix Released → Invalid
wheezer (mrnoblestone) wrote :

I realize this thread a bit stale, but this very topic is now being discussed at bugzilla.gnome by both metacity and pidgin devs. As one of those pidgin users that absolutely hates this new behavior, and wishes it worked in Ubuntu as it always did, I would be most grateful if someone from here could be there, to see if there is not some reasonable way to restore that behavior (so clicking on a buddy, warps the conversation window to the Buddy list's workstation and activates it)

The discussion is toward the bottom of this thread at gnome:
http://bugzilla.gnome.org/show_bug.cgi?id=482354

And my original discussion with pidgin people here:
http://www.nabble.com/Lost-workspace-function-with-Ubuntu-Hardy-tt18352855.html#a18462577

Changed in metacity:
status: Confirmed → In Progress
Biji (biji) wrote :

i experience this issue on intrepid also
(using compiz, gnome)

Nicholas J Kreucher (kreucher) wrote :

Removing the patch to metacity (see above) works only if you are not using compiz. The same annoying behavior now effects compiz (intrepid). I really don't understand the logic here. We have a blinking notification saying "click here! click me!" so you do, and seemingly nothing happens. For tomboy, you click the always present tomboy icon, select a note, and expect it to appear, always, period. This is enough to make newbies think Linux is totally broken and go back to Windows. *** sigh ***

Related bugs:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/217462
https://bugs.launchpad.net/tomboy/+bug/263656

PLEASE BRING BACK THE SANE BEHAVIOR OF ALLOWING WINDOWS TO SWITCH TO THE CURRENT DESKTOP!!!!!!!!!!!!!!!!

Nicholas J Kreucher (kreucher) wrote :

For an excellent overview of this issue (w/metacity), see:
http://blogs.gnome.org/metacity/2008/10/20/by-these-presents/

Changed in metacity:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Triaged
Changed in pidgin:
importance: Undecided → Low
status: New → Triaged
Changed in metacity:
status: In Progress → Fix Released
Pedro Villavicencio (pedro) wrote :

the metacity package containing the fix is already in jaunty, marking the task as fixed, thanks.

Changed in metacity:
status: Triaged → Fix Released
Changed in metacity:
status: Invalid → Fix Released

This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 9 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Changed in pidgin (Fedora):
status: In Progress → Won't Fix
Changed in metacity:
importance: Unknown → Medium
Mörgæs (moergaes) on 2013-11-24
Changed in pidgin (Ubuntu):
status: Triaged → Invalid
Changed in pidgin (Fedora):
importance: Unknown → Low
Changed in metacity (Fedora):
importance: Unknown → High
status: Fix Released → Won't Fix
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.