After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 72125 - Non-focused tab's gtkmozembed steals focus when done loading
Non-focused tab's gtkmozembed steals focus when done loading
Status: RESOLVED FIXED
Product: galeon
Classification: Deprecated
Component: Mozilla interaction
1.3.0
Other Linux
: Low normal
: 1.3.19
Assigned To: galeon-maint
Yanko Kaneti
: 64638 65662 67391 67801 68905 69257 72422 72477 73121 78228 79484 81774 83086 83437 87909 88110 90016 91242 91462 91773 94538 100891 101487 116139 119255 122557 123879 130132 132804 134787 136621 139117 140513 143225 143421 143928 144233 144257 144640 147857 152054 157503 159348 161021 171613 (view as bug list)
Depends on:
Blocks: 100891
 
 
Reported: 2002-02-21 13:03 UTC by David B. Harris
Modified: 2005-03-31 18:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed workaround (1.25 KB, patch)
2002-09-21 19:28 UTC, Tommi Komulainen
none Details | Review
Proposed workaround (updated) (348 bytes, patch)
2004-03-26 06:38 UTC, Pav Lucistnik
none Details | Review
unrealize inactive embeds (535 bytes, patch)
2004-04-19 10:06 UTC, Tommi Komulainen
none Details | Review
unrealize inactive embeds (509 bytes, patch)
2004-04-19 15:43 UTC, Tommi Komulainen
none Details | Review
stop mozilla from grabbing focus (2.37 KB, patch)
2004-11-22 18:40 UTC, Tommi Komulainen
none Details | Review

Description David B. Harris 2002-02-21 13:03:10 UTC
There's some sort of race condition or something; what happens
is(basically), there's a tab loading in the background. Up/down keys are
working just normally. The not-focused tab finishes loading, and then any
up/down, PgUp/PgDown and such keystrokes arn't sent to the focused tab, but
rather to the gtkmozembed of the tab that just finished loading.

Here's how I reproduce consistently. Takes a bit of fast mousework, I
think, or a slow-ish connection maybe.

Open up two tabs. Tab 1 is www.slashdot.org, tab 2 is www.arstechnica.com
Bring tab 2 to focus; hit reload.
Very quickly, move to tab 1. Hit the up/down keys or whatever so that it's
obvious that gtkmozembed has focus. Keep hitting those keys until tab 2 is
done loading and rendering.
If tab1 is still scrolling, obviously it didn't work. But if it did stop
scrolling, hit End or somesuch; switch to tab 2 and the Arstechnica page
will be scrolled to the bottom.

Thanks for all the great work :)
Comment 1 Marco Pesenti Gritti 2002-02-24 17:01:58 UTC
Coooool ;) Finally a reproducable testcase ;) the bad site seem to be
arstechnica, now I can try to see what is going wrong ;)
Comment 2 David B. Harris 2002-02-24 18:53:50 UTC
Just adding a note, as we discussed on IRC; it isn't Arstechnica
specifically (since we can both reproduce with two Slashdot.org
pages), and I've noticed the irritating behaviour everywhere. :)

(Again, this is just for completeness in the bug report - send to
/dev/null, Marco :)
Comment 3 Marco Pesenti Gritti 2002-02-24 19:31:45 UTC
My plan is to kill all the focus bugs asap, that require:

1 Understand mozilla focus
2 Understand gtk focus
3 Understand gtkmozembed implementation of mozilla focus
4 Fix it ;)

Will not be easy, but it's really time to solve this.
Comment 4 Marco Pesenti Gritti 2002-02-25 18:04:28 UTC
*** Bug 67391 has been marked as a duplicate of this bug. ***
Comment 5 Marco Pesenti Gritti 2002-02-25 18:04:51 UTC
*** Bug 72477 has been marked as a duplicate of this bug. ***
Comment 6 Marco Pesenti Gritti 2002-02-25 18:07:28 UTC
http://bugzilla.mozilla.org/show_bug.cgi?id=127694
Comment 7 Marco Pesenti Gritti 2002-03-01 14:05:28 UTC
*** Bug 68905 has been marked as a duplicate of this bug. ***
Comment 8 Marco Pesenti Gritti 2002-03-01 14:05:46 UTC
*** Bug 64638 has been marked as a duplicate of this bug. ***
Comment 9 Marco Pesenti Gritti 2002-03-01 14:06:17 UTC
*** Bug 67801 has been marked as a duplicate of this bug. ***
Comment 10 Marco Pesenti Gritti 2002-03-01 14:07:46 UTC
*** Bug 69257 has been marked as a duplicate of this bug. ***
Comment 11 Yanko Kaneti 2002-03-01 19:31:36 UTC
*** Bug 72422 has been marked as a duplicate of this bug. ***
Comment 12 Joe Kislo 2002-04-17 04:26:47 UTC
Moving the mouse really quickly and switching tab's may get tiresome.
 The easiest way of causing this problem to occour is have 1 tab which
reloads itself after 1 second.  Then try to use a web-form in a second
tab.  You won't be able to type in the webform, because the other tab
will steal your keyboard focus.  Just write a webpage with a META
refresh tag in it. 

meta http-equiv="REFRESH" content="1; http://localhost/reload.html"

And make the meta-refresh reload the same page.  It will loop,
reloading itself every second.  And every time it reloads, it will
steal your focus.  

We use a percentage progress bar in our web application, and it
updates the progress bar every couple seconds.  If I have one of these
status bars in a tab in galeon, I can't use galeon anymore because it
continually steals the focus. :(

Comment 13 Marco Pesenti Gritti 2002-04-17 11:06:25 UTC
According to blizzard whole mozilla focus suck badly ... hopefully 
this will be solved soon.
Comment 14 Yanko Kaneti 2002-04-22 10:55:25 UTC
*** Bug 79484 has been marked as a duplicate of this bug. ***
Comment 15 Yanko Kaneti 2002-05-18 14:53:02 UTC
*** Bug 78228 has been marked as a duplicate of this bug. ***
Comment 16 Yanko Kaneti 2002-05-26 23:55:56 UTC
*** Bug 83086 has been marked as a duplicate of this bug. ***
Comment 17 Yanko Kaneti 2002-05-28 13:49:21 UTC
*** Bug 81774 has been marked as a duplicate of this bug. ***
Comment 18 Yanko Kaneti 2002-05-29 19:29:01 UTC
*** Bug 83437 has been marked as a duplicate of this bug. ***
Comment 19 Yanko Kaneti 2002-06-18 20:26:49 UTC
*** Bug 65662 has been marked as a duplicate of this bug. ***
Comment 20 Marco Pesenti Gritti 2002-06-30 13:40:24 UTC

*** This bug has been marked as a duplicate of 73121 ***
Comment 21 Marco Pesenti Gritti 2002-06-30 13:41:31 UTC
*** Bug 73121 has been marked as a duplicate of this bug. ***
Comment 22 Yanko Kaneti 2002-07-14 16:23:39 UTC
*** Bug 88110 has been marked as a duplicate of this bug. ***
Comment 23 Yanko Kaneti 2002-08-06 19:05:00 UTC
*** Bug 90016 has been marked as a duplicate of this bug. ***
Comment 24 Yanko Kaneti 2002-08-20 12:35:28 UTC
*** Bug 91242 has been marked as a duplicate of this bug. ***
Comment 25 Yanko Kaneti 2002-08-22 14:11:37 UTC
*** Bug 87909 has been marked as a duplicate of this bug. ***
Comment 26 Yanko Kaneti 2002-08-23 00:43:53 UTC
*** Bug 91462 has been marked as a duplicate of this bug. ***
Comment 27 Yanko Kaneti 2002-08-27 13:51:57 UTC
*** Bug 91773 has been marked as a duplicate of this bug. ***
Comment 28 Daniel James 2002-09-17 08:54:21 UTC
Just a little bit of info. This isn't limited to tabs as far as I can
tell. This also happens with me with a window that has been popup up
by another window... Here's my story:

I have a constantly refreshing page (http-equiv="refresh" content="30")

This page opens another window when I click on a link... The window
that opens has a <textarea> that I type into.

I type and type and when the original page refreshes I type no more.
I've tried this in mozilla aswell and the bug wasn't there. I could
reproduce this all day..
Comment 29 Tommi Komulainen 2002-09-20 19:30:29 UTC
Any progress with this one?  Looks to me as if galeon developers are
waiting for input from mozilla and vice versa.  But is anyone doing
anything about it? :)
Comment 30 Marco Pesenti Gritti 2002-09-20 19:52:58 UTC
This need to be fixed in mozilla. We cant do much about it.
Comment 31 Tommi Komulainen 2002-09-20 21:04:47 UTC
I realize that.  I was just wondering if you know if someone's been
doing something that isn't recorded in these two bugs, because the
bugs seem being mostly ignored.  Last entry in the mozilla bug is
still waiting for an answer.
Comment 32 Marco Pesenti Gritti 2002-09-21 10:25:29 UTC
Nope, blizzard says mozilla focus sucks and he should go through it at
some point. But I dont think he did any work on it.
Comment 33 Tommi Komulainen 2002-09-21 19:27:18 UTC
While we wait for something to happen in the mozilla front, maybe
someone wants to try a workaround instead.

I just can't believe it could be this simple; just set the embed in
inactive tabs insensitive.  For all I can tell it works perfectly. 
But it just can't be that easy, what am I missing here?

Of course, it's still a workaround... :-/
Comment 34 Tommi Komulainen 2002-09-21 19:28:08 UTC
Created attachment 11204 [details] [review]
Proposed workaround
Comment 35 Erich Schubert 2002-09-21 23:24:42 UTC
I tried porting this to galeon 1.2.6, but it didn't fix it here.
(It didn't change anything that is - didn't break anything either ;)
Here's the diff i tried, maybe i didn't do it the right way...

--- src/window_callbacks.c      2002-09-22 00:15:12.000000000 +0200
+++ src/window_callbacks.c      2002-09-22 00:18:02.000000000 +0200
@@ -2062,12 +2062,14 @@
                embed_save_modified_location (old_embed);
 
                /* no longer the active embed */
+               gtk_widget_set_sensitive(GTK_WIDGET
(old_embed->mozembed), FALSE);
                old_embed->is_active = FALSE;
                embed_update_tab_status (old_embed);
        }
 
        /* this is now the active embed */
        embed->is_active = TRUE;
+       gtk_widget_set_sensitive(GTK_WIDGET (embed->mozembed), TRUE);
        window->active_embed = embed;
 
        /* move this embed to front of tab list to maintain stacking
order */
Comment 36 Yanko Kaneti 2002-09-30 18:01:30 UTC
*** Bug 94538 has been marked as a duplicate of this bug. ***
Comment 37 Yanko Kaneti 2002-12-18 05:50:01 UTC
*** Bug 101487 has been marked as a duplicate of this bug. ***
Comment 38 Mark Howard 2003-03-03 21:38:00 UTC
This appears to be fixed, but should probably have a second opinion
before closing it and the mozilla bug report
http://bugzilla.mozilla.org/show_bug.cgi?id=127694 (they want to know
if it's fixed)
Comment 39 Tommi Komulainen 2003-07-22 18:05:57 UTC
*** Bug 116139 has been marked as a duplicate of this bug. ***
Comment 40 Yanko Kaneti 2003-08-06 12:31:28 UTC
*** Bug 119255 has been marked as a duplicate of this bug. ***
Comment 41 Yanko Kaneti 2003-09-17 17:02:03 UTC
*** Bug 122557 has been marked as a duplicate of this bug. ***
Comment 42 John McCutchan 2003-09-17 17:15:41 UTC
What is going on with this bug? Its definitly not fixed.
Comment 43 Tommi Komulainen 2003-09-17 17:29:43 UTC
I think this is the latest reincarnation.

http://bugzilla.mozilla.org/show_bug.cgi?id=210373
Comment 44 Crispin Flowerday (not receiving bugmail) 2003-10-05 10:00:03 UTC
*** Bug 123879 has been marked as a duplicate of this bug. ***
Comment 45 Crispin Flowerday (not receiving bugmail) 2003-10-15 21:50:08 UTC
*** Bug 100891 has been marked as a duplicate of this bug. ***
Comment 46 Mark Howard 2003-11-19 15:01:26 UTC
Update:
http://bugzilla.mozilla.org/show_bug.cgi?id=127694
  Has a testpage which reproduces the bug consistently for me galeon
1.3.10, mozilla 1.5
  This report was marked resolved worksforme. I've just reopened it.

http://bugzilla.mozilla.org/show_bug.cgi?id=210373
  Seems to have technical discussions, but no responses from mozilla
developers for the past month. 
Comment 47 Crispin Flowerday (not receiving bugmail) 2004-01-02 14:23:10 UTC
*** Bug 130132 has been marked as a duplicate of this bug. ***
Comment 48 Crispin Flowerday (not receiving bugmail) 2004-01-28 20:25:10 UTC
*** Bug 132804 has been marked as a duplicate of this bug. ***
Comment 49 Felipe Massia Pereira 2004-02-13 10:52:22 UTC
Just another case: if I'm writing something in a form while a tab is
loading, when it finishes loading, it steals the focus.

The following page has a meta refresh and reproduces the bug (while
using a form).
http://acm.uva.es/cgi-bin/OnlineJudge?Status:Valladolid:IDSCMALN:16:-1:1.00:15::

I'm using galeon1.3.12 from Debian unstable.
Comment 50 Crispin Flowerday (not receiving bugmail) 2004-02-19 13:00:25 UTC
*** Bug 134787 has been marked as a duplicate of this bug. ***
Comment 51 Crispin Flowerday (not receiving bugmail) 2004-03-09 15:04:46 UTC
*** Bug 136621 has been marked as a duplicate of this bug. ***
Comment 52 Pav Lucistnik 2004-03-26 06:38:31 UTC
Created attachment 25940 [details] [review]
Proposed workaround (updated)

Patch from comment #34 updated to apply and work with Galeon 1.3.14
Comment 53 Tommi Komulainen 2004-04-19 10:00:54 UTC
It's been said that the set_sensitive workaround doesn't always work.  Under
what circumstances it fails hasn't been figured out (a little like the original
mozilla bug.)
Comment 54 Tommi Komulainen 2004-04-19 10:06:18 UTC
Created attachment 26806 [details] [review]
unrealize inactive embeds

This is a little more drastic workaround.  It unrealizes the embed widget when
it becomes active and shows it again when it becomes active.  Unrealized
widgets can't possibly grab focus so it might be slightly more effective.

However this is ugly, we really really shouldn't need to do thing like that.

gtkmozembed does initialization on realize.  I've no idea if or how much this
hack is making it leak.
Comment 55 Tommi Komulainen 2004-04-19 15:43:58 UTC
Created attachment 26819 [details] [review]
unrealize inactive embeds

This one actually compiles with recent CVS.
Comment 56 Crispin Flowerday (not receiving bugmail) 2004-04-19 19:17:30 UTC
*** Bug 140513 has been marked as a duplicate of this bug. ***
Comment 57 Tommi Komulainen 2004-04-26 19:18:02 UTC
*** Bug 139117 has been marked as a duplicate of this bug. ***
Comment 58 Crispin Flowerday (not receiving bugmail) 2004-05-26 17:30:00 UTC
*** Bug 143225 has been marked as a duplicate of this bug. ***
Comment 59 Crispin Flowerday (not receiving bugmail) 2004-05-31 09:07:17 UTC
*** Bug 143421 has been marked as a duplicate of this bug. ***
Comment 60 Crispin Flowerday (not receiving bugmail) 2004-06-08 08:34:38 UTC
*** Bug 143928 has been marked as a duplicate of this bug. ***
Comment 61 Yanko Kaneti 2004-06-12 20:43:17 UTC
*** Bug 144233 has been marked as a duplicate of this bug. ***
Comment 62 Crispin Flowerday (not receiving bugmail) 2004-06-13 20:16:04 UTC
*** Bug 144257 has been marked as a duplicate of this bug. ***
Comment 63 Paulo Sedrez 2004-06-17 00:42:55 UTC
Still present: Fedora Core 2 (updated), Mozilla 1.6, Galeon 1.3.15 (binary from
galeon.sf.net).

ALWAY reproduceable: any tab or window that ends the loading steals the focus,
except when you set the Windows Manager to Focus-Follows-Mouse (or focus on
enter-window, whatever); in this case, only tabs to the focused window steal the
focus.
Comment 64 Crispin Flowerday (not receiving bugmail) 2004-06-19 09:26:16 UTC
*** Bug 144640 has been marked as a duplicate of this bug. ***
Comment 65 Crispin Flowerday (not receiving bugmail) 2004-07-19 07:19:58 UTC
*** Bug 147857 has been marked as a duplicate of this bug. ***
Comment 66 Ken Bloom 2004-08-02 03:41:22 UTC
I applied patch from comment #54 and tested, I have mozilla bug 127694's test
case running in another tab, and whenever the test case reloads, this input box
(where I'm typing the bug report) loses focus, and reverts to typeahead find,
but on the same tab that I've been using. (As opposed to the old behavior where
the *hidden* tab would steal typeahead find from an active tab's forms and from
an active tab's typeahead find.) So it looks like even with comment #54's patch
applied, the JavaScript behavior still needs work.

Could you guys please come up with a fix soon, even if it's a very hackish fix.
This is very annoying behavior, and the bug is several years old.
Comment 67 Crispin Flowerday (not receiving bugmail) 2004-09-07 11:50:51 UTC
*** Bug 152054 has been marked as a duplicate of this bug. ***
Comment 68 Tommi Komulainen 2004-11-06 10:06:05 UTC
*** Bug 157503 has been marked as a duplicate of this bug. ***
Comment 69 Paulo Sedrez 2004-11-07 12:57:10 UTC
I just found this problem is present in Netscape 7.02 for Windows also. So it is
a mozilla core problem.
Comment 70 Tommi Komulainen 2004-11-22 18:40:01 UTC
Created attachment 34035 [details] [review]
stop mozilla from grabbing focus

Yet another idea to work around this thing.  This time trying to stop mozilla
from grabbing the focus unless it's triggered by user interaction.
Comment 71 Tommi Komulainen 2004-11-23 20:56:50 UTC
The previous patch is now committed to CVS:

http://mail.gnome.org/archives/cvs-commits-list/2004-November/msg04799.html
Comment 72 Tommi Komulainen 2004-11-28 10:43:45 UTC
*** Bug 159348 has been marked as a duplicate of this bug. ***
Comment 73 Yanko Kaneti 2004-12-11 13:00:28 UTC
*** Bug 161021 has been marked as a duplicate of this bug. ***
Comment 74 Christian Lohmaier 2005-02-08 21:45:10 UTC
could this issue be reopened?
With galeon 1.3.19 the focus is not lost when the new tab has finished loading,
but immediately when the tab is opened.
E.g. I write a comment in this box, then use my middle mouse button to open one
of the duplicates in a new tab -> I cannot continue typing in the box.

To be able to continue typing in the page, I have to switch to another tab and
back and click in the box.

It should be enough to click in the box (no forced switching between tabs please)
Comment 75 Crispin Flowerday (not receiving bugmail) 2005-02-13 10:59:04 UTC
The issue with middle clicking on a link stealing focus has been fixed in CVS.

I would also much rather have new bugs rather than re-opening this one.
Comment 76 Crispin Flowerday (not receiving bugmail) 2005-03-27 13:10:42 UTC
*** Bug 171613 has been marked as a duplicate of this bug. ***
Comment 77 Christian Lohmaier 2005-03-31 18:07:37 UTC
just want to confirm that the middle-clicking-focus-stealing is solved with 1.3.20