Closed Bug 593307 Opened 14 years ago Closed 14 years ago

Close Window from minimized taskbar icon loses control of the application

Categories

(Core :: Widget: Win32, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- final+

People

(Reporter: mak, Assigned: Felipe)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Steps to reproduce: 1. open Firefox new profile, then open multiple tabs (any number that will cause the save session dialog to appear, from 2 on) 2. minimize browser to taskbar 3. right click on the minimized icon in taskbar and choose Close Window Expected: 1. I get asked to save session, window closes and process goes away What happens: 1. Nothing seems to happen 2. clicking on any preview in Aeropeek brings up a small empty window frame (small rectangle in upper part of the desktop) 3. No way to get back control of the application, have to kill the process I was able to reproduce at any try, but checking with another guy on IRC he was unable to reproduce. Since if this is reproduceable causes completely lose of application control, and forces a process kill, I'm filing it to get further confirmation of it working or broken.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6pre) Gecko/20100902 Firefox/4.0b6pre
i can reproduce this with a currently nightly on my Win 7 machine, with a new profile.
blocking2.0: --- → final+
So, this seems to be related to the Save session modal dialog, if a user choices "never ask me again" the dialog does not come up and it works fine. Supposing related to opening a modal dialog when app is minimized.
blocking2.0: final+ → ---
Asking blocking because forces user to kill the process, there is no other way to exit this situation.
blocking2.0: --- → ?
Probably the same as bug 586299, a regression from bug 520805. The new window inherits the X/Y position of the parent window. The parent is minimized and probably has negative coordinates, and that puts the new window offscreen where it can't receive focus. I'll try to confirm this hypothesis.
Assignee: nobody → felipc
Blocks: 520805
bug 593307 is about a http basic auth popup. Minimize FF while the page is loading and before you get the dialog.
So this was actually a small widget bug (first part of the patch), but I think that other uncovered bugs might also not be prepared to handle a window created offscreen. This happens easily after bug 520805 if the top-left corner of the opener window is offscreen and we inherit it via "centerscreen". I think it'd be a good idea to ensure that the X/Y inherited falls into the same screen as the opener. Johnny, requesting feedback on the approach here. If you think that's a reasonable thing I can clean up that code into a separate function (if wanted).
Attachment #476873 - Flags: feedback?(jst)
yeah, that's exactly the issue I reported there https://bugzilla.mozilla.org/show_bug.cgi?id=593307 ... been like this for a while, since beta 3 actually up to the latest minefield build.
Comment on attachment 476873 [details] [diff] [review] Constrain initial position to same screen feedback+. You could move left, top, width and height inside the if check where they're actually used etc, but generally looks like a good approach.
Attachment #476873 - Flags: feedback?(jst) → feedback+
How does this patch handle the case when I have two screens, do view-source, move the view-source window to a different screen from the browser, close the view-source window, and then view source again?
The patch won't affect it (view-source will return to the second screen through its persist screenX/Y attribute). Even a window that have a defined screenX to start at isn't created at that spot, but rather moved there after its XUL is loaded. (Besides, the patch only affects windows loaded as "centerscreen".. all others will continue to be created at 0,0. Though if that wasn't the case it wouldn't make a difference AFAICT)
Not an exact duplicate of 599090 - original bug report mentions being able to right click the minimized icon in the status bar but when modal window bug hits right clicking the tab in window's task bar does not produce the expected context window.
Update patch: cleaned the code to be added into a new function. Also wrote a test.
Attachment #476873 - Attachment is obsolete: true
Attachment #478424 - Flags: review?(jst)
Attachment #478424 - Flags: review?(jst) → review+
Comment on attachment 478424 [details] [diff] [review] Constrain initial position to same screen - v2 Jim, I see that you've looked at mBounds recently, so asking the addl. review for the widget change here. Here's what happened: The window was created at negative coordinates, but mBounds assumed it was 0,0 and only retrieved the width/height of the window. Later the window was supposed to be moved to 0,0, but as mBounds.{x,y} already had that value, nsWindow::Move bailed out early and no move happened, keeping the window off-screen. (The test needs three files but it's simple: it opens a window at -3000,-3000, and this window opens a new "dependent,centerscreen" window and verifies that this window is correctly moved on-screen.)
Attachment #478424 - Flags: review?(jmathies)
(In reply to comment #19) > Created attachment 478424 [details] [diff] [review] > Constrain initial position to same screen - v2 > > Update patch: cleaned the code to be added into a new function. Also wrote a > test. Does everything still work correctly considering you're now creating windows offscreen? (I imagine it would, since windows itself moves windows off screen for various reasons.) Also, do we get a WM_MOVE event here on create? I wonder how content / nsxulwindow handle the negative coords if we do.
(In reply to comment #21) > (In reply to comment #19) > > Created attachment 478424 [details] [diff] [review] [details] > > Constrain initial position to same screen - v2 > > > > Update patch: cleaned the code to be added into a new function. Also wrote a > > test. > > Does everything still work correctly considering you're now creating windows > offscreen? (I imagine it would, since windows itself moves windows off screen > for various reasons.) Yeah, and also on multiple-monitor setups windows can have negative coordinates, so it's at least known that nothing breaks horribly in that case. Note though that with the appshell changes in this patch, no window will be created offscreen, as that code's purpose is to ensure that a window is created at an X/Y at an existing screen. (This means that the widget change here is not strictly necessary to resolve this bug, but I believe that for correctness it's needed) > > Also, do we get a WM_MOVE event here on create? I wonder how content / > nsxulwindow handle the negative coords if we do. I'll check this
> > Also, do we get a WM_MOVE event here on create? I wonder how content / > > nsxulwindow handle the negative coords if we do. > > I'll check this Confirmed that no WM_MOVE is sent with negative coordinates during window creation
Comment on attachment 478424 [details] [diff] [review] Constrain initial position to same screen - v2 ok, r+ on the widget parts.
Attachment #478424 - Flags: review?(jmathies) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Target Milestone: --- → mozilla2.0b8
Target Milestone: mozilla2.0b8 → mozilla2.0b7
Depends on: 656131
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: