Hmm, I was confused - when I said earlier:

> A proper "event timestamp" is passed over the remote protocol, but is thrown 
> away because we also have a > "desktop startup ID". The "desktop startup ID" 
> is useful when presenting a new window and includes the 
> timestamp information, but isn't something we can use when we're raising an 
> existing window.

I was assuming that the timestamp in:

void
nsGTKRemoteService::SetDesktopStartupIDOrTimestamp(const nsACString& 
aDesktopStartupID,
                                                   PRUint32 aTimestamp)

was the timestamp from the startup notification protocol, but as you
point out, it's not that but rather the event timestamp for the
PropertyNotify - so yes, it's not quite proper, and in very rare cases
you could get unwanted focus stealing.

The timestamp from the startup notification protocol actually can be
parsed out of the ID - SetUserTimeAndStartupIDForActivatedWindow() in
the GTK+ nsWindow.cpp doe this using libsn, but it also can be done
directly from the string value. (See http://standards.freedesktop.org
/startup-notification-spec/startup-notification-latest.txt for how the
timestamp is embedded in the launch ID.)

So before calling 'timestamp = GTKToolkit->GetFocusTimestamp();' it
would be better to try and parse the timestamp out of the launch ID.

NOTE: That's independent from this bug report - the behavior reported
here is as expected unless the user has gone off and interacted further
with the originating window before the window is raised.

It's certainly possible to like the old behavior, but it's hard to
justify it as a correct - why should Firefox come to the front when it
isn't already running, but stay in the background if it was already
running? A program like a terminal could offer an "open in the
background" option for links which always passed a 0 timestamp to the
startup notification spec so Firefox never took focus even if it was
already running.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/1009816

Title:
  Firefox comes to front when opening link via external program.

Status in The Mozilla Firefox Browser:
  Confirmed
Status in “firefox” package in Ubuntu:
  Invalid

Bug description:
  Firefox 13 no longer remains in the background if opening a new tab
  from a different window, such as an email.

  Prior to the upgrade, the only time Firefox would rise to the
  foreground was if it were not already running.

  1) Ubuntu  12.04 LTS
  2) The version of the package you are using: firefox 
13.0+build1-0ubuntu0.12.04.1
  3) See above.
  4) See above.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: firefox 13.0+build1-0ubuntu0.12.04.1
  Uname: Linux 3.4.1-030401-generic i686
  NonfreeKernelModules: nvidia
  AddonCompatCheckDisabled: False
  AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.25.
  ApportVersion: 2.0.1-0ubuntu8
  Architecture: i386
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC0:  bjwest     2280 F.... pulseaudio
  BuildID: 20120601173917
  CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 
not found.
  Card0.Amixer.info:
   Card hw:0 'SB'/'HDA ATI SB at 0xfd200000 irq 16'
     Mixer name : 'Realtek ALC887-VD'
     Components : 'HDA:10ec0887,10438444,00100302'
     Controls      : 44
     Simple ctrls  : 21
  Channel: release
  Date: Wed Jun  6 22:35:45 2012
  ForcedLayersAccel: False
  IfupdownConfig:
   auto lo
   iface lo inet loopback
  InstallationMedia: Kubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
  IpRoute:
   default via 192.168.1.1 dev eth1  proto static 
   169.254.0.0/16 dev eth1  scope link  metric 1000 
   192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.119  metric 
1
  IwConfig:
   lo        no wireless extensions.
   
   eth1      no wireless extensions.
  Plugins:
   Skype Buttons for Kopete - /usr/lib/mozilla/plugins/skypebuttons.so (kopete)
   Shockwave Flash - /usr/lib/flashplugin-installer/libflashplayer.so
  PrefErrors: Unexpected character before close parenthesis @ 
[Profile]/extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781}/defaults/preferences/greasemonkey.js:4
  ProcEnviron:
   LANGUAGE=
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  Profiles: Profile0 (Default) - LastVersion=13.0/20120601173917 (In use)
  RelatedPackageVersions: kopete 4:4.8.3-0ubuntu0.1
  RfKill:
   
  RunningIncompatibleAddons: False
  SourcePackage: firefox
  UpgradeStatus: Upgraded to precise on 2012-04-28 (40 days ago)
  dmi.bios.date: 05/30/2011
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: 0503
  dmi.board.asset.tag: To be filled by O.E.M.
  dmi.board.name: M5A97
  dmi.board.vendor: ASUSTeK Computer INC.
  dmi.board.version: Rev 1.xx
  dmi.chassis.asset.tag: To Be Filled By O.E.M.
  dmi.chassis.type: 3
  dmi.chassis.vendor: To Be Filled By O.E.M.
  dmi.chassis.version: To Be Filled By O.E.M.
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr0503:bd05/30/2011:svnTobefilledbyO.E.M.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnASUSTeKComputerINC.:rnM5A97:rvrRev1.xx:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
  dmi.product.name: To be filled by O.E.M.
  dmi.product.version: To be filled by O.E.M.
  dmi.sys.vendor: To be filled by O.E.M.

To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1009816/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to