Closed
Bug 41813
Opened 25 years ago
Closed 24 years ago
textbox.focus() will grab focus from other mozilla windows
Categories
(Core :: XUL, defect, P1)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla0.9
People
(Reporter: Marko.Macek, Assigned: hyatt)
References
(Blocks 1 open bug, )
Details
Attachments
(7 files)
496 bytes,
text/html
|
Details | |
7.10 KB,
patch
|
Details | Diff | Splinter Review | |
2.80 KB,
patch
|
Details | Diff | Splinter Review | |
979 bytes,
patch
|
Details | Diff | Splinter Review | |
4.48 KB,
patch
|
Details | Diff | Splinter Review | |
3.21 KB,
patch
|
Details | Diff | Splinter Review | |
998 bytes,
patch
|
Details | Diff | Splinter Review |
If I start load/reload of bugzilla.mozilla.org page and then quickly switch to
another window the previous browser window will raise as the page gets loaded.
I am not sure what causes this but it happens on other pages too. :(
Comment 1•25 years ago
|
||
i can't seem to repro on win98. Asa, any better luck?
Comment 2•25 years ago
|
||
I can't reproduce this under NT .
Reporter | ||
Comment 3•25 years ago
|
||
It helps if the connection is slow :(
I can reproduce this many times even on other pages. I'll try to investigate
this more.
Comment 4•25 years ago
|
||
over to XPApps for evaluation
Assignee: asa → don
Component: Browser-General → XP Apps
QA Contact: doronr → sairuh
Comment 5•25 years ago
|
||
I'm seeing this on Linux, CVS pull @ noon 07/03. It seems to happen at random
with all sorts of pages, not just this one. If someone can confirm, please
change the title and OS.
Reporter | ||
Comment 7•25 years ago
|
||
This happens on many other pages too. I am not sure about Linux, but I will pay
more attention...
It could be related to page contents. I will try to find a test if this is so.
Comment 8•25 years ago
|
||
I have also noticed this bug (first I feared it was a "feature") and am finally
able to reproduce it here with Mozilla 2000071609 on Linux/Gnome/Enlightenment.
Step 1: open www.google.com
Step 2: open either www.javalobby.org or java.sun.com in a second window.
Step 3: switch to the google window, hit reload and switch to some other window
while mozilla is repainting. The google window will raise itself.
Oddly enough, you have to use google, using eg. mozilla.org does not trigger the
bug. Since both java.sun.com and javalobby.org trigger the "no plugin found"
window because of the java applets, it might be related to this. Note that
though google's page looks quite simple, it uses javascript (opposed to
mozilla.org). This might also be important...
I hope this helps find this nasty bug, as it was not simple finding a testcase.
The bug seemed to appear quite randomly...
Reporter | ||
Comment 9•25 years ago
|
||
It's happening on Linux too, and also on other pages. Updating status. It can
also happen as frames are being loaded.
bug 44535 is possibly related.
OS: Windows NT → All
Hardware: PC → All
Summary: bugzilla.mozilla.org page raises itself on load → page raises itself on load (randomly)
Reporter | ||
Comment 10•25 years ago
|
||
Comment 11•25 years ago
|
||
This seems to have disappeared on 2000080104-M17 on Linux. Can someone confirm?
Comment 12•25 years ago
|
||
yeah, i cannot seem to repro using 2000.08.02.04-m17 [comm, beta2] bits on
linux, winnt or mac.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
Comment 13•25 years ago
|
||
This is very reproducible on 2000080213 (M18) on Linux:
- open two windows
- on window 1, type into the location bar http://www.cnn.com/, press enter
- quickly go to window 2 and click on the title bar to raise it (before the
first window finishes loading)
- when window 1 finishes loading, it raises itself.
Should this bug be reopened?
Comment 14•25 years ago
|
||
The procedure I posted shows the bug on 2000080204 (M17) and 2000080213 (M18) on
Linux. Reopening.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Comment 15•25 years ago
|
||
Confirmed the behavior that hchcheng@scg.math.uwaterloo.ca describes on Linux
(Red Hat 6.2) using 200080213 and using http://cnn.com as a test site.
Reporter | ||
Comment 16•25 years ago
|
||
Still happens on windows build 2000080220 (bugzilla.mozilla.org is raised).
Comment 17•25 years ago
|
||
Comment 18•25 years ago
|
||
When a textbox in a non-active mozilla window tries to grab focus, we don't
expect to notice anything until we switch back to that window. But if another
Mozilla window is front when the .focus() method is activated, the Mozilla
window with the textbox jumps to the front.
Windows 98, Mozilla build 2000 082708.
Keywords: correctness
Summary: page raises itself on load (randomly) → textbox.focus() will grab focus from other mozilla windows
Comment 20•24 years ago
|
||
On windows, it is (if nothing else) exactly what Nav4.x and IE5 do: when
.focus() is set on a text input, in a browser window that is in the background,
that window will be raised to the top. (i.e., current windows behaviour is
correct).
On mac, this raise is not the platform convention (per sfraser), and we do not
raise the background window. (i.e., current mac behaviour is correct).
However, on linux, we should not raise when .focus() is set, but in mozilla
we do (Nav 4.x we did not). (i.e., current linux behaviour is wrong).
Comment 21•24 years ago
|
||
i didn't know that other browsers did it as well, but i still think it
shouldn't be that way. it's annoying much more often than it's useful,
afaict. should this go to the "user interface: design feedback" component?
Comment 22•24 years ago
|
||
Ok, this comes down to two distinct issues then:
1) we raise on linux, and should not
2) an RFE to change the behaviour on Windows.
Can we call this the bug for (1), and a separate bug addressing the behaviour
on Windows can be filed for (2).
Comment 23•24 years ago
|
||
split off bug 50665 for windows. changing this bug to be linux-only.
OS: All → Linux
Comment 24•24 years ago
|
||
navtriage team sez: we say this is a 'future' bug for now.
Claudius sez: hey this looks like a toolkit thing. Reassigning to trudelle.
Assignee: don → trudelle
Status: REOPENED → NEW
Component: XP Apps → XP Toolkit/Widgets
QA Contact: claudius → jrgm
Target Milestone: M20 → Future
Comment 26•24 years ago
|
||
So this is an interesting bug. We've discussed this before, and it seems to be
correct behavior for JS to be able to steal focus at any time. Now, being a mac
user, this sort of thing makes my skin crawl. Being the person that has to muck
around with the demon focus code, making the platforms behave differently in this
case also makes my skin crawl!
I don't know what the "right thing" is in this case.
Status: NEW → ASSIGNED
Comment 27•24 years ago
|
||
saari - if you fix bug 50665 at the same time as this one, you might not need
any platform-dependent code :)
Comment 28•24 years ago
|
||
Except for one minor thing; there are many people that think the JS spec
specifies the current behavior.
Comment 29•24 years ago
|
||
*** Bug 55016 has been marked as a duplicate of this bug. ***
Comment 30•24 years ago
|
||
Where is the relevant JS spec? (I can't find it with Google.) I think it
extremely strange that textbox.focus() should be considered to mean the same as
{window.focus(); textbox.focus()}, leaving authors with no means of giving a
textbox focus *without* also giving the window focus.
When Google, Bugzilla, etc use textbox.focus(), do you really think they mean
to annoy the user by giving the window focus too? I don't.
Comment 31•24 years ago
|
||
All the test cases I've seen use a text entry box of some kind. There's a place
to start looking(if nobody has found the source for the problem yet). I've
contacted a few authors of pages that do this, and they say, "No, I didn't
intend that! Thanks for letting me know, I'll look into it."
As an aside, I don't know how to navigator bugzilla.mozilla.org very well, but
this is something related: As far as windows are concerned under Linux, a Raise
is not the same as a Focus, they're completely seperate. A few window managers
treat them the same, but not many. Some platform-dependant code should be
modified so that when Mozilla wants to Raise a window, it should also Focus said
window. Thanks a bunch! :)
Comment 32•24 years ago
|
||
Two pieces of information: first, this is independant of Javascript itself,
because I browse with JS off and this happens to me too on Linux. (fvwm2 is
my window manager.)
Second: this is a very irritating and dangerous bug. Every time you steal
focus, the user's typing can suddenly go somewhere other than where they
expected and wanted it to go; this can have bad to very bad consequences
and is at the least annoying. Being interrupted in the middle of something
and losing part of your work generally does that.
Explicitly stealing focus is evil and should be avoided unless there is
a truly compelling reason. Raising a window asynchronously can wind up
stealing focus, so it is almost as bad. (It also destroys the user's own
stacking order, which is bad in its own way.)
Comment 33•24 years ago
|
||
Judging by comments on Slashdot at the M18 release, and by Chris here, I think we
have more than one bug here. If Mozilla is raising the window on the completion
of *every* page load with some window manager configurations (as some Slashdot
comments suggested), please file a separate bug for that. If it is raising the
window on some pages which don't use textbox.focus() or window.focus() (or when
JavaScript is diabled), please find the common factor in those pages and file a
separate bug for that too.
Comment 34•24 years ago
|
||
This is annoying people, target mozilla 0.9
Target Milestone: Future → mozilla0.9
Comment 35•24 years ago
|
||
> If Mozilla is raising the window on the completion of *every* page
> load with some window manager configurations (as some Slashdot
> comments suggested), please file a separate bug for that.
Bug 55691
Comment 36•24 years ago
|
||
My personal experience with this bug is that Mozilla only raises a window when the web page wishes a text-input box to have keyboard focus when the page is done rendering. I don't know what HTML that means, but I know it happens on plenty of pages without javascript.
Comment 37•24 years ago
|
||
adding my 2 cents here...
This is truly evil. textbox.focus() (or whatever) should NOT affect the window;
just the widgets within the window. (disclaimer: I haven't read any JS spec on
this but if it disagrees with me, I think the spec is *WRONG*!)
If I'm switching between a Navigator and Composer window, I don't expect the
Navigator window to come to the front while I'm typing in Composer. The same
goes for Mail. If I switch to a non-mozilla app, do I lose focus from that
window? (I don't think so.) This is really inconsistent. We shouldn't allow
JS browsing so much reign over all of the windows in our mozilla apps.
Adding dogfood as a keyword since this is a major blocker for me using daily or
NS6 builds because the windows are constantly gaining/losing focus at unexpected
times and really slowing me down.
Keywords: dogfood
Comment 40•24 years ago
|
||
*** This bug has been marked as a duplicate of 28467 ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 24 years ago
Resolution: --- → DUPLICATE
Comment 42•24 years ago
|
||
Reopening based on Trudelle's 2001-04-06 comment in bug 28467.
Status: VERIFIED → REOPENED
Resolution: DUPLICATE → ---
Updated•24 years ago
|
Priority: P3 → P1
Comment 44•24 years ago
|
||
->P1
Assignee | ||
Comment 45•24 years ago
|
||
*** Bug 50665 has been marked as a duplicate of this bug. ***
Comment 46•24 years ago
|
||
Since bug 50665 (the Windows version) was marked as a duplicate, this bug is
now All/All.
Again.
OS: Linux → All
Assignee | ||
Comment 47•24 years ago
|
||
*** Bug 28467 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 48•24 years ago
|
||
*** Bug 69259 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 49•24 years ago
|
||
Assignee | ||
Comment 50•24 years ago
|
||
Assignee | ||
Comment 51•24 years ago
|
||
Assignee | ||
Comment 52•24 years ago
|
||
Assignee | ||
Comment 53•24 years ago
|
||
Assignee | ||
Comment 54•24 years ago
|
||
Assignee | ||
Comment 55•24 years ago
|
||
The above patches fix several focus issues (including the one covered in this
bug). Ignore the patch to nsFileLocations in the appshell patch. I only meant
to include nsWebShellWindow there.
Status: NEW → ASSIGNED
Comment 56•24 years ago
|
||
I asked for a comment explaining why you need to SetActive before the activate
message, and why Mozilla can't be as simple as the embedding GOTFOCUS/Activate
logic. Hope Linux and Mac like this as much as Windows, also! It'll come out
in the wash soon enough.
Other than that comment request, sr=brendan@mozilla.org.
/be
Assignee | ||
Comment 57•24 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 58•24 years ago
|
||
Filed bug 76621 for the textbox in the Search sidebar panel stealing focus from
page content.
Comment 59•24 years ago
|
||
This is great, I'm glad it got fixed. Is there a bug on self.focus() causing
the same behavior? I notice this when using, for example, hotmail. If not,
I'll spin off a new bug.
Comment 60•24 years ago
|
||
Several remaining problems:
bug 92252 http://www.messaging.sprintpcs.com/sms/ steals focus
bug 92879 textbox.select() still grabs focus from other mozilla windows
Comment 61•23 years ago
|
||
More remaining problems:
bug 124750 Other tab steals focus with javascript textbox.focus()
bug 138646 textbox.blur() steals focus from other windows
You need to log in
before you can comment on or make changes to this bug.
Description
•