Closed Bug 91631 Opened 23 years ago Closed 23 years ago

MailNews steal focus from Browser

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P1)

x86
Windows 2000
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: philanderton, Assigned: saari)

References

Details

Select a newsgroup in newsreader, switch to a browser window before newsgroup
loads - newsreader always steals focus back.
This is obviously related to bug 77675, but wasn't fixed there.
I don't see this on WinNT.  I do see the mail window steal focus if I switch to
a browser window just after creating the mail window, though.
Confirming it, marking as a blocker for 88810

according to #mozillazine should be assigned to saari and event handling. 
Blocks: 88810
Status: UNCONFIRMED → NEW
Ever confirmed: true
Moving as I said in the previous comment.
Assignee: sspitzer → saari
Component: Mail Window Front End → Event Handling
Product: MailNews → Browser
0.9.4 because of enterprise
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.4
Target Milestone: mozilla0.9.4 → mozilla0.9.5
can I get a better way to reproduce this? I'm not seeing it on my win2k box.
Use a slower news server, perhaps? I also get the problem on starting mailnews, 
if I switch back to the browser as soon as the mailnews window appears.
Target Milestone: mozilla0.9.5 → mozilla0.9.6
I started seeing this one when outliner went in. I see it both with mail and
with news, but I find the news case much easier to reproduce.
I believe mail & news also steals focus from chatzilla as well as the browser.
Priority: -- → P1
Target Milestone: mozilla0.9.6 → mozilla0.9.7
scott, who on the mailnews team would own the code that focuses the mail window
thread pane when it is finished loading? That is pulling the mail window onto of
others, and I'm trying to figure out what API that is going though so I can
patch it to check a window's activation state.

cc'ing Seth and Sean. 

I think it's happening in
/mailnews/base/resources/content/msgMail3PaneWindow.js.  Look for
SetFocusThreadPane() which is implemented in
/mailnews/base/resources/content/mail3PaneWindowCommands.js which tells the
outliner to focus.

I did a quick test and removed the call to SetFocusThreadPane() from:
 OnItemEvent: function()

in msgMail3PaneWindow.js.  It seems to have fixed the problem.  I can't say that
it fixes it 100% because I was able to reproduce the problem only about 80% of
the time.

If someone has a build that can reproduce it 100% of the time, I can help apply
the fix to see if it really works.
So what does removing the call break? :-)
Target Milestone: mozilla0.9.7 → mozilla0.9.8
On WinXP with build 2001121608 the browser no longer steals focus, but mailnews
does.  Have a browser open, switch to mailnews, select an unloaded folder, and
alt-tab back to the browser; mailnews steals the focus when the folder has
completed loading.

Reproduced with IMAP folders and newsgroups.

Exceptionally annoying if you're using multiple desktops..

the patch to bug 70097 might also fix this problem.
Target Milestone: mozilla0.9.8 → mozilla0.9.9
I believe this might be fixed, at least it looks fixed on my current trunk win2k
build. Either that or I'm still not fast enough to reproduce it with either test
case. If someone still sees it on the trunk build, please list your OS and
machine speed, and reopen the bug. Do be sure to test it on trunk though, since
a focus fix just went in that might have fixed this.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
I don't see this with a rather large ng, n.p.m.mail-news on build 2002-02-13-03
running Windows 2000.

If anyone sees this, please re-open (with build ID, exact steps, etc).

Verified FIXED.
Status: RESOLVED → VERIFIED
QA Contact: esther → stephend
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.