Bug 307581 - apps jump workspaces when urls opened
apps jump workspaces when urls opened
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: metacity (Show other bugs)
7
All Linux
high Severity high
: ---
: ---
Assigned To: Søren Sandmann Pedersen
Fedora Extras Quality Assurance
:
: 337721 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-26 14:09 EDT by Bill Nottingham
Modified: 2014-06-18 05:09 EDT (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-02 15:17:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
partial fix for firefox (1.32 KB, patch)
2007-10-12 02:34 EDT, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Bill Nottingham 2007-09-26 14:09:57 EDT
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.
Comment 1 Adam Goode 2007-09-30 20:17:03 EDT
I will second this. Very irritating!
Comment 2 Christopher Aillon 2007-10-01 15:22:40 EDT
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()
Comment 3 Christopher Aillon 2007-10-01 15:23:35 EDT
er, hops workspaces
Comment 4 Colin Walters 2007-10-01 15:34:29 EDT
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

Comment 5 Bill Nottingham 2007-10-01 15:48:25 EDT
FWIW, commenting out the call to gdk_window_focus() in the patch makes it DTRT
for me.
Comment 6 Owen Taylor 2007-10-01 16:00:33 EDT
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.
Comment 7 Colin Walters 2007-10-01 16:03:13 EDT
Bill, what effect does that have in the single-workspace case?
Comment 8 Colin Walters 2007-10-01 16:04:24 EDT
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.
Comment 9 Bill Nottingham 2007-10-01 16:10:27 EDT
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.
Comment 10 David Zeuthen 2007-10-11 16:06:50 EDT
We need to fix this for F8...
Comment 11 Jeremy Katz 2007-10-11 17:48:48 EDT
This is also happening in compiz... so more than just metacity at work here.
Comment 12 Christopher Aillon 2007-10-11 19:26:44 EDT
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.
Comment 13 Matthias Clasen 2007-10-11 23:06:19 EDT
The long discussion leading to the current metacity behaviour can be found 
here: http://bugzilla.gnome.org/show_bug.cgi?id=166379
Comment 14 Bill Nottingham 2007-10-12 00:48:32 EDT
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.
Comment 15 Bill Nottingham 2007-10-12 02:34:52 EDT
Created attachment 225081 [details]
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.
Comment 16 David Zeuthen 2007-10-17 16:15:02 EDT
"This is not a blocker"
Comment 17 Jens Petersen 2007-10-18 00:33:20 EDT
<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
Comment 18 Bill Nottingham 2007-10-18 11:32:34 EDT
*** Bug 337721 has been marked as a duplicate of this bug. ***
Comment 19 Colin Walters 2007-10-18 16:33:15 EDT
Note there is now a patch for metacity upstream at:
http://bugzilla.gnome.org/show_bug.cgi?id=482354#c2
Comment 20 Colin Walters 2007-10-18 17:25:49 EDT
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).
Comment 21 Colin Walters 2007-10-18 20:15:15 EDT
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.
Comment 22 Bill Nottingham 2007-10-18 20:33:39 EDT
(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.
Comment 23 Jens Petersen 2007-10-18 20:52:52 EDT
(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. :)
Comment 24 Colin Walters 2007-10-18 21:15:11 EDT
(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.


Comment 25 Colin Walters 2007-10-18 21:17:11 EDT
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.
Comment 26 Christopher Aillon 2007-10-19 08:21:59 EDT
We'll probably want this metacity fix for FC7 too before Firefox's support makes
it there.
Comment 27 Matthias Clasen 2007-10-22 09:22:20 EDT
Fixed in F8, moving off blocker
Comment 28 Mauricio Pretto 2007-10-22 15:56:16 EDT
Its fixed for me after last update in F8
Cheers
Comment 29 Bug Zapper 2008-05-14 10:31:36 EDT
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
Comment 30 Peter van Egdom 2008-06-02 15:17:23 EDT
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.

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