GNOME Bugzilla – Bug 465488
Focus stealing prevention bug
Last modified: 2009-03-12 20:52:47 UTC
Please describe the problem: Opening 2nd instance of evince does not raise window if there already is a 1st instance running. Steps to reproduce: 1. Open terminal 2. run 'evince x.pdf &' 3. alt-tab back to terminal 4. run 'evince y.pdf &' Actual results: Focus is left on terminal Expected results: Focus should be given to y.pdf Does this happen every time? Yes Other information: At first glance it seems like a metacity bug, but I think the behavior happens because evince is not following the protocol for opening new windows. Opening pdfs from nautilus works fine (y.pdf gets focus.) I've skimmed some of the old FSP bugs for metacity, and I think the problem is this: when the 2nd instance is launched, and it forwards the action to the 1st instance, the "last user interaction" timestamp needs to be updated for the 1st instance. Since the open-window request is much newer than the "last user interaction" timestamp, metacity thinks that the 1st instance is trying to steal focus. Firefox also has this problem of not updating the timestamp. Here is a page with a patch for firefox, so you can see what I mean: http://cgwalters.livejournal.com/tag/firefox+focus+gnome+linux Note that epiphany does not have this bug, so you could also look there to see how it's done. Here is an old bug thread discussing the "last user interaction" timestamp thing: http://bugzilla.gnome.org/show_bug.cgi?id=149028
hmm, I can't reproduce it with evince from svn trunk, and I think we haven't changed anything related to this from 0.8.x to 0.9.x.
A Debian user have reported a similar problem with Evince and Metacity 2.20: "The problem occurs (only, AFAIS) when the other instance of evince is running on a different desktop/workspace in a minimized window! All other combinations did not make the problem to occur. So yes, it is related to the issue you mentioned. When reproducing it, please focus on the combination I described." I can however, not reproduce this myself. The full report is at http://bugs.debian.org/475372
I can reproduce this on demand, using GNOME Terminal: Steps: 1. Open Evince with a PDF document. 2. That that document still open, open another. The second document does not have focus.
Also reported in Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/evince/+bug/232219
I still can't reproduce it with evince 2.24
Can't reproduce it on Ubuntu Hardy with evince 2.22.2 and metacity 2.22.0. It doesn't care whether Evince is maximised or not.
I just (very easily) reproduced it on Ubuntu Hardy with Evince 2.22.2 and 2.22.0.
I'm using sloppy focus-follows-mouse. If I change to click-to-focus indeed I can reproduce it. Sorry for the noise!
This was fixed in 2.23.91 by the following: http://svn.gnome.org/viewvc/evince/trunk/shell/ev-application.c?r1=3130&r2=3131
Thanks, marking fixed then.