Closed Bug 435848 Opened 14 years ago Closed 13 years ago

Chrome popup panel appears on screen even when window is minimized.

Categories

(Core :: XUL, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: pdgiddie+mozilla, Assigned: enndeakin)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008052504 Minefield/3.0pre
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008052504 Minefield/3.0pre

When openPopup() is called for a panel whilst the browser window is minimized, the panel appears on the screen, even though it is anchored to the browser window.

Reproducible: Always

Steps to Reproduce:
1. Open panel whilst browser window is minimized (see provided XPI)
Actual Results:  
Panel pops up on screen without browser window.
In Windows, the panel appears in the top-left-hand corner of the screen.
On the Mac, the panel appears where it should have appeared if the window were visible.
Linux appears to act as expected.

Expected Results:  
Panel remains hidden until window containing anchor is visible.

This is a very important issue for the Firefox Companion for eBay.
Attached file Proof of Concept XPI
This extension will pop up a panel saying "Hello" on the right-hand side of the statusbar 3 seconds after the window opens.
Assignee: nobody → jag
Component: General → XUL
Product: Firefox → Core
QA Contact: general → xptoolkit.widgets
We don't generally prevent popups from opening from chrome, even if the window is hidden or minimized.

As a workaround, you could check window.windowState before opening the popup.

Although a bug seems to exist on Mac where the windowState isn't updated.
Thanks, I'd be happy to work around the problem if necessary, but I'd need windowState or similar to be fixed.  I remember trying every conceivable interface to find a way to determine whether a window was minimized, but to no avail.  That was with Firefox 2 though.

Regarding this bug though, I can understand you not wanting to hide popups from chrome, but it seems as though this scenario has not been considered, as the behaviour is undefined.  Each platform behaves differently in this situation.  If I remember correctly, Linux even behaves as I expected.
- fix case on Mac where window.windowState isn't updated
- on Mac, window.restore() doesn't work
- don't show popups when the window is minimized
Assignee: jag → enndeakin
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #335056 - Flags: superreview?(roc)
Attachment #335056 - Flags: review?(joshmoz)
Attachment #335056 - Flags: superreview?(roc) → superreview+
Attachment #335056 - Flags: review?(joshmoz) → review+
Thanks Neil; I finally got around to trying the patch, and it works perfectly for me :)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
This was backed out due to an intermittent test failure on Linux.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
On Linux I sometimes see the window not minimizing properly due to the window not being fully displayed yet. The fix for this is to run the test on 'focus', rather than 'load'. I'll try checking in a patch with this change to see if it fixes the problem.
Checked in and the focus check fixed the tests.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Blocks: 502457
Can I ask that this be revered, see bug 502457.  There are legitimate uses for this behavior.
You need to log in before you can comment on or make changes to this bug.