Closed Bug 380953 Opened 17 years ago Closed 16 years ago

should start with blank page if last tab closed with Ctrl+W

Categories

(Firefox :: Session Restore, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 343876

People

(Reporter: mikel, Unassigned)

Details

(Keywords: uiwanted)

As discussed on mozilla.dev.apps.firefox (http://groups.google.com/group/mozilla.dev.apps.firefox/browse_thread/thread/61710faf19168094/6a931886b2f8cc77), if I close the last tab using Ctrl+W, I expect this tab to be closed before the browser is closed, and thus I should be shown my home page when Firefox starts up, even if I'm using session restore.  Instead, the last-used tab is shown.

Myk said:

In other words, we're doing this:

   user says "close last tab"
   tab closes
   browser quits

When we should be doing this:

   user says "close last tab"
   tab closes
   sessionstore updates stored session info
   browser quits
The session store code (http://lxr.mozilla.org/mozilla1.8/source/browser/components/sessionstore/src/nsSessionStore.js) refers to _lastWindowClosed a lot.  I think it might actually be a feature, altho not one that makes any sense to me.

If we have to have explicit code for this case, should it be to push the home page onto the stack rather than loading the last tab the user closed?

It also looks like there's a case where the browser has just be upgraded.  In this case, the what's new page should be shown *instead* of any other page (home page, last page, etc.).
(In reply to comment #0)
> if I close the last tab using Ctrl+W

While it is possible to technically distinguish Ctrl+W and Alt+F4, I'm not sure people will grasp or agree with the difference.

> thus I should be shown my home page when Firefox starts up

That's bug 343876. The alternative would be to show the blank tab left "from last time" (since the option doesn't read "Show my windows and tabs from last time _or my homepage if only one blank tab/window was left_").

Modifying this bug's summary to make the distinction... (you'd get your behavior if both bugs are fixed).

(In reply to comment #1)
> refers to _lastWindowClosed a lot.

That's rather to ensure that - if you close the last browser window before the download manager - you still get that window restored after you've closed all Firefox windows and restarted. That code will stay unchanged even if this bug gets fixed.

> It also looks like there's a case where the browser has just be upgraded.  In
> this case, the what's new page should be shown *instead* of any other page
> (home page, last page, etc.).

They already get shown *in addition to* the last viewed pages - otherwise you'd get a dataloss issue.
Keywords: uiwanted
Summary: should start with home page if last tab closed with Ctrl+W → should start with blank page if last tab closed with Ctrl+W
I'm not sure I agree exactly with the new summary.  I'd prefer to see my home page (as in, this is a completely new session, as if the session restore feature didn't exist, therefore I should see my home page) rather than a blank page.  (But it sounds like we're working in the same direction.)

In the case of the browser just being upgraded and there being no tabs from the previous session, IMHO we should show *only* the upgrade (what's new) page, just like we would if there was no session restoration.
> That's bug 343876. The alternative would be to show the blank tab left
> "from last time" (since the option doesn't read "Show my windows and tabs
> from last time _or my homepage if only one blank tab/window was left_").

Isn't that the difference between that bug (343876) and this one (380953)?  In the case that the tab bar is always visible (browser.tabs.autoHide=false), an empty tab is created if the last one is closed.  If the tab bar is only shown when there's two or more tabs (browser.tabs.autoHide=true), no empty tab is created, thus there is no reason for a pref such as "Show my windows and tabs from last time _or my homepage if only one blank tab/window was left_".  In this case, there are no tabs in the session, so you can act like the browser has no session and just use the home page.  In the other case, I assume there *is* an empty tab in the session?
(In reply to comment #4)
> Isn't that the difference between that bug (343876) and this one (380953)?  In
> the case that the tab bar is always visible (browser.tabs.autoHide=false), an
> empty tab is created if the last one is closed.  If the tab bar is only shown
> when there's two or more tabs (browser.tabs.autoHide=true), no empty tab is
> created, thus there is no reason for a pref such as "Show my windows and tabs
> from last time _or my homepage if only one blank tab/window was left_".  In
> this case, there are no tabs in the session, so you can act like the browser
> has no session and just use the home page.  In the other case, I assume there
> *is* an empty tab in the session?

Hmm, I guess I misunderstood what you were asking for.  The behavior I thought you were asking for was this:

* autoHide = true
-> close the last page (whose tab is hidden)
* Firefox quits
-> start Firefox again
* Firefox displays *blank* page

But you're actually asking for this:

* autoHide = true
-> close the last page (whose tab is hidden)
* Firefox quits
-> start Firefox again
* Firefox displays *home* page

Whereas bug 343876 is asking for this:

* autoHide = false
-> close the last page
* browser displays blank page
-> quit Firefox
-> start Firefox again
-> browser displays *home* page

FWIW, I think what you're actually asking for and what bug 343876 is asking for are fundamentally the same, i.e. for Firefox to display the home page upon startup if the user closed all pages before (or in the process of) quitting the application the last time, and it makes sense to have bug 343876 represent both cases.

In which case this bug can address the issue that closing the last "tab" with autohide = true and then starting the browser again displays the last page loaded into the browser rather than a blank page, i.e. the current behavior is this:

* autoHide = true
-> close the last page (whose tab is hidden)
* Firefox quits
-> start Firefox again
* Firefox displays *last* page

Whereas I think it should be this (unless it should instead be the behavior requested by bug 343876):

* autoHide = true
-> close the last page (whose tab is hidden)
* Firefox quits
-> start Firefox again
* Firefox displays *blank* page
(In reply to comment #4)
> Isn't that the difference between that bug (343876) and this one (380953)?

That difference is almost too subtle. In the scenario from comment #0 there'd indeed be no single tab in the current session which should technically lead to Firefox restoring nothing (resp. its equivalent: a single blank tab - since Firefox can't display tab-less windows).

> In this case, there are no tabs in the session, so you can act like the
> browser has no session and just use the home page. 

There are two issues with your conclusion:

1. A browsing session doesn't consist exclusively of its tabs. One further notable aspect is the list of recently closed tabs inside a window. Should that list still be restored or discarded as well?

2. The other two startup options are "Show my home page" and "Show a blank page". Why would the first automatically trump the latter? (that point should rather be discussed in bug 343876 though)
Myk, in that case I don't support this bug.  I would rather it was duped to the other one.  Does anybody support this bug as per Myk's definition?

I'll take up the conversation in bug 343876.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.