Open Bug 632323 Opened 14 years ago Updated 13 years ago

Port |Bug 629485 - Show close window warning when closing the last window| to SeaMonkey

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(blocking-seamonkey2.1 -)

Tracking Status
blocking-seamonkey2.1 --- -

People

(Reporter: sgautherie, Unassigned)

References

()

Details

(Keywords: dataloss)

      No description provided.
Porting this only makes sense if we first port Bug 592822.

The dependency tree looks something like:

[Bug 592822] Remove quit warning dialog.
  [Bug 629485] Show close window warning when closing the last window.
  [Bug 632270] Remove browser-lastwindow-close-requested.
  [Bug 632271] Entirely remove support for quit dialog.

So I suggest you morph this bug to say Port 592822 instead.
Without having fully checked the implications I'd argue that porting the functionality should be independent from the decision about whether to change the pref defaults (as happened in bug 592822).
http://blog.zpao.com/post/3174360617/about-that-quit-dialog
http://hg.mozilla.org/mozilla-central/file/84921e24be9c/browser/components/nsBrowserGlue.js#l443

About That Quit Dialog…

Remember when we turned it off a couple weeks ago? We did that by just flipping the browser.warnOnQuit preference to false. I mentioned that you could get old behavior back by flipping that preference back to true. That’s not going to work anymore.

I just landed bug 629485 to change things again, so pay attention. When we turned off the quit dialog, we took away any way of stopping the last window from closing without any warning, even if you explicitly set the visible pref browser.tabs.warnOnClose which would show the window closing warning (when you have multiple tabs). That wasn’t so cool. So we played around with the logic and made that possible. But in order to do so, we had to change the default value of browser.warnOnQuit to true and create a new preference which controls the quit dialog (browser.showQuitDialog). I know this sounds a bit inane, but there really wasn’t a better way to do it and maintain browser.warnOnQuit == false as an override.

It’s all a bit confusing, so I’ve documented the conditions under which we won’t show a dialog, as well as the rules for choosing which dialog to show. Some of that comment is perfectly clear; the rest requires a little bit of understanding of the code (but it shouldn’t be too hard to figure out if you want).

Don’t expect me to write another post like this. I don’t expect any further changes to how this stuff works.
TL;DR

    * We enabled the window closing dialog when closing the last window would otherwise just quit (mostly important to Windows and Linux users).
    * If you want the quit dialog back, set browser.showQuitWarning to true and make sure browser.warnOnQuit is also true.

Update: Feb. 8, 2011: Yup. I fucked that up a little bit. We aren’t showing the quit dialog if you close the last window, even with the prefs mentioned above. That should be fixed in the next nightly
I'm not convinced we need this, but Neil should probably decide whether is valid at all. Not blocking for the moment, but Neil can change if he thinks this is warranted.
blocking-seamonkey2.1: ? → -
All I want is for SeaMonkey to prompt "Do you really want to quit?". My browser.warnOnQuit is true, but I think this intentionally does nothing if you've told SeaMonkey to save and restore tabs, see the long bug 419009 ("cripes-on-burnt-toast, the various quit option interactions are a snakepit of user confusion" -- mbeltzner). I added browser.showQuitDialog=true and browser.showQuitWarning=true (mentioned in bug 641500)... nothing helps. If I accidentally press Ctrl+Q instead of Ctrl+W in "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120119 Firefox/10.0 SeaMonkey/2.7", all my SeaMonkey windows go away. :-(

Looking at the comments in nsBrowserGlue.js , it seems you're overthinking this to the detriment of all the users commenting on a slew of bugs.
  // There are several cases where we won't show a dialog here ...
please just show a dialog if browser.somePreferenceToAlwaysWarnOnQuit is true. Thank you.
You need to log in before you can comment on or make changes to this bug.