Window position is not persisted if quickly moved then dismissed

RESOLVED FIXED in mozilla0.9.1

Status

()

Core
XUL
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Simon Fraser, Assigned: Dan M)

Tracking

Trunk
mozilla0.9.1
PowerPC
Mac System 8.5
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
We fail to save window positions when you dismiss a dialog with the escape key. 
To repro:

1. Open the Open location dialog.
2. Move it to a new location
3. Hit the cancel button
4. Bring it up again. Note that it's position was saved.

Now:

1. Open the Open location dialog.
2. Move it to a new location
3. Press the 'Escape' key
4. Bring it up again. Note that it's position was not saved.

What's weird is that dismissing the dialog with command-. on Mac *does* save its 
location.
(Reporter)

Comment 1

17 years ago
So it seems that the issue here is a quick move/dismiss, which dismisses the 
window before the persistence timer fires. This is easy to do using keys to 
dismiss dialogs.
Summary: Window position is not persisted when dismissing a dialog with the escape key → Window position is not persisted if quickly moved then dismissed
(Assignee)

Comment 2

17 years ago
Thanks for the analysis, Simon. We just need to fire the persistence timer 
during window teardown, before the persistence-to-localstore code has come and 
gone. This will fix the bug:

Index: xpfe/appshell/src/nsWebShellWindow.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp,v
retrieving revision 1.340
diff -u -r1.340 nsWebShellWindow.cpp
--- nsWebShellWindow.cpp	2001/04/18 01:39:35	1.340
+++ nsWebShellWindow.cpp	2001/04/30 21:32:41
@@ -1730,6 +1730,13 @@
    }
 #endif
 
+  PR_Lock(mSPTimerLock);
+  if (mSPTimer) {
+    mSPTimer->Cancel();
+    mSPTimer = nsnull;
+    StoreBoundsToXUL(mSPTimerPosition, mSPTimerSize, PR_FALSE);
+  }
+  PR_Unlock(mSPTimerLock);
 
    return nsXULWindow::Destroy();
 }
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
(Assignee)

Comment 3

17 years ago
patch is in (has been for several days)
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.