Closed Bug 155002 Opened 22 years ago Closed 21 years ago

mozilla should remain active application when dismissing an alert that was raised when mozilla wasn't active

Categories

(SeaMonkey :: UI Design, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: deanis74, Assigned: danm.moz)

References

Details

Wow, that's a long summary!

1. Enter in a non-existent url, eg. www.blahblahblah.com
2. Quickly Alt+Tab to another application
3. Wait for the taskbar icon to flash
4. Click the taskbar icon and dismiss the alert

Expected Results: Mozilla is now the active application

Actual Results: Focus switches back to the application changed to in step 2

2002062908 on Win2K
Step 2 doesn't have to be another application, it can be another Mozilla window.
Adding dmose to cc: list, since this is a focus bug.
I did a bit debugging. Making nsXULWindow::ActivateParent() return immediately
seems to make this work almost perfectly. The focus doesn't jump around, but the
parent doesn't get it either. This is the same behavior that Delphi apps seem to
have. In conclusion, it seems to me that ActivateParent() doesn't activate what
it should. 
Then again, I might be wrong. It seems to be intermittent.
Removing myself.  I know next to nothing about the focus code.  You'd probably
be better off ccing blizzard@mozilla.org and danm@netscape.com.
Whoops, I meant to cc: danm about window focus, not dmose.
I did some digging on this again. It seems that Windows will focus the last
active window when the modal window is hidden. I think we should always do
something alike ActivateParent() after hiding the modal window. Currently
ActivateParent() is only used in certain situations because (according to a
comment) it causes problems otherwise. Could it be because it is called before
the parent window is enabled? I'll probably try calling it after ExitModalLoop().
Ere, I always thought that Windows would activate the uppermost enabled window
when you hide a top-level window. Is the modal parent not being enabled soon enough?
Keywords: nsbeta1
-> danm for a look.  We should try to fix this for Buffy since it is in line
with the theme of polish.
Assignee: sgehani → danm
I've checked in a fix for bug 189085. It fixed this issue too (at least for me).
Marking fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Great work Ere!
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.