Open
Bug 848116
Opened 12 years ago
Updated 2 years ago
nsIWindowMediator is not returning the correct active window, also window.focus() DNW
Categories
(Core :: XUL, defect)
Tracking
()
NEW
People
(Reporter: evold, Unassigned)
References
Details
Attachments
(2 files)
I've attached a test add-on, that expects one non-private window to be opened when it is installed/enabled.
The add-on basically does this:
1. Opens a private window
2. Waits for the private window to focus and checks that it is the active window from nsIWindowMediator
3. Steps 1&2 for non private window
4. Step 1&2 again
5. Step 3 again
At this point the focused window should be the non-private window, but it is actually the private window. Also the check in step 4 that the active window from nsIWindowMediator is the private window will always fails.
Reporter | ||
Comment 1•12 years ago
|
||
Hmm sorry this isn't specific to private windows, if I remove the private flag in the test add-on then I still have the same issue.
Component: Private Browsing → General
Reporter | ||
Updated•12 years ago
|
Summary: Using nsIFocusManager with Private Windows has issues → nsIWindowMediator is not returning the correct active window
Reporter | ||
Updated•12 years ago
|
Summary: nsIWindowMediator is not returning the correct active window → nsIWindowMediator is not returning the correct active window, also window.focus() DNW
Reporter | ||
Comment 2•12 years ago
|
||
Reporter | ||
Comment 3•12 years ago
|
||
you can probably use the main.js file on Builder or with ScratchKit for testing too.
Reporter | ||
Comment 4•12 years ago
|
||
I had to work around this issue in bug 846856 and bug 846854, so there are two other examples too.
Comment 5•12 years ago
|
||
Sounds more like a Core:XUL bug.
I'd tend to think that we are hitting a race condition when focus event is dispatched.
We are trying to change the focused window during the same event loop iteration...
The important fact is that, it only fails if we try to focus a window while we are in the focus event listener. i.e. if we delay window.focus() with setTimeout 0, it works.
I wouldn't surprised if some state variable introduce this behavior:
http://mxr.mozilla.org/mozilla-central/source/dom/base/nsFocusManager.cpp
Component: General → XUL
Product: Firefox → Core
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•