Last Comment Bug 814630 - Thunderbird 17.0 closes all windows if multiple are opened
: Thunderbird 17.0 closes all windows if multiple are opened
Status: VERIFIED FIXED
[gs][regression:tb17]
: regression
Product: Thunderbird
Classification: Client Software
Component: Mail Window Front End (show other bugs)
: 17 Branch
: x86_64 Windows 7
: -- normal (vote)
: Thunderbird 20.0
Assigned To: Richard Marti (:Paenglab)
:
Mentors:
https://getsatisfaction.com/mozilla_m...
: 815122 821077 821612 821793 (view as bug list)
Depends on:
Blocks: 805185
  Show dependency treegraph
 
Reported: 2012-11-23 01:56 PST by chke85
Modified: 2014-10-05 04:35 PDT (History)
15 users (show)
vseerror: in‑testsuite?
vseerror: in‑moztrap?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
fixed
18+
fixed


Attachments
proposed fix (1.21 KB, patch)
2012-11-26 09:29 PST, Richard Marti (:Paenglab)
mconley: review+
standard8: approval‑comm‑aurora+
standard8: approval‑comm‑beta+
standard8: approval‑comm‑esr17+
Details | Diff | Splinter Review

Description chke85 2012-11-23 01:56:34 PST
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0
Build ID: 20121119183901

Steps to reproduce:

Reproduced with Windows 7 Ultimate x64 SP1 and Thunderbird 17.0
Steps:
1) open Thunderbird
2) open a Mail (or something else) in a new tab within the current window
3) drag the tab out of the current window scope
4) now close either the initial window or the newly created one

Additional:
After closing Thunderbird, open it anew and the multiple windows should start with the process. Now the steps 2-4 can be repeated to open more and more windows for the current instance and every time Thunderbird closes all windows.
Only the manual deletion of the window-JSONs in the profile's "session.json" reverts the instance to one window.


Actual results:

Thunderbird closes ALL windows, not only the selected one.


Expected results:

Only the selected window should close and the remaining windows should stay opened.
Thus draging tabs outer the current window scope should open stand-alone windows.
Comment 1 sfhowes 2012-11-23 11:39:32 PST
Probably related to the problem recently reported in gsfn:

https://getsatisfaction.com/mozilla_messaging/topics/two_message_windows_are_displayed_when_thunderbird_launches

Solution is the same, to delete session.json.
Comment 2 Wayne Mery (:wsmwk, NI for questions) 2012-11-23 20:56:02 PST
the might be related. but does deleting session.json really prevent all windows from being closed?  I wouldn't think so.

However, https://getsatisfaction.com/mozilla_messaging/topics/when_thunderbird_17_0_starts_on_xp_it_runs_two_or_three_copies#reply_10632085 is quite correct, setting mail.tabs.drawInTitlebar=false resolves the problem.

see https://getsatisfaction.com/mozilla_messaging/topics/new_window_close_behavior_in_tb_17_0
Comment 3 Richard Marti (:Paenglab) 2012-11-24 00:47:48 PST
The same happens when you use Exit from menu. With draw in title bar the close button is using "cmd_quit" like Exit in menu. This is on every Windows system with draw in title bar except Vista/Win7 Aero. On Aero the native buttons with their system function is used. It exists also "cmd_close" but this closes only one tab after the other until the last tab is closed.

Mike, do you know a function we can use?
Comment 4 Wayne Mery (:wsmwk, NI for questions) 2012-11-24 09:12:32 PST
Richard, FWIW, alt+F4 closes a single window just fine under these conditions
Comment 5 chke85 2012-11-24 09:40:38 PST
(In reply to Wayne Mery (:wsmwk) from comment #2)
> the might be related. but does deleting session.json really prevent all
> windows from being closed?  I wouldn't think so.
> 
> However,
> https://getsatisfaction.com/mozilla_messaging/topics/
> when_thunderbird_17_0_starts_on_xp_it_runs_two_or_three_copies#reply_10632085
> is quite correct, setting mail.tabs.drawInTitlebar=false resolves the
> problem.
> 
> see
> https://getsatisfaction.com/mozilla_messaging/topics/
> new_window_close_behavior_in_tb_17_0

I'll try this workaround in about ~ 36 hours, then I'll sit in front of the PC on which the error was reproduced.
And to note: I did not delete the session.json at all, I only changed the array property "windows" to one element thus resetting the amount of windows which are opened at the start of Thunderbird.
With due respect, changing the mail.tabs.drawInTitlebar value is only a workaround, no fix! If I call a close-window-function (it does not matter how) I expect that the window I selected is closed and not some other windows in the background. Then they should not appear in a separate window in the first place...
Comment 6 chke85 2012-11-26 01:34:53 PST
Alright, changing Thunderbird to the more "classical" window layout does change the close window behaviour. Now it does what I expect, it only closes the current window and not all open windows.

But the bug with the default window layout is still reproducible.
Comment 7 Mike Conley (:mconley) - (Needinfo me!) 2012-11-26 07:12:39 PST
(In reply to Richard Marti [:Paenglab] from comment #3)
> Mike, do you know a function we can use?

window.close() might be sufficient - that's my first instinct on the matter.
Comment 8 Richard Marti (:Paenglab) 2012-11-26 09:29:46 PST
Created attachment 685204 [details] [diff] [review]
proposed fix

Yess Mike, window.close() is what we need.
Comment 9 Wayne Mery (:wsmwk, NI for questions) 2012-11-26 09:53:32 PST
FYI 
a) https://getsatisfaction.com/mozilla_messaging/topics/thunderbird_inbox_opens_twice describes bug 805185 - I just merged about 10 new gsfn topics created in the last 12 hours.
b) but not seeing nearly as many reports about clicking close terminates multiple TB  windows

As mentioned on IRC, it's not clear to me if bug 805185 is an outright duplicate because I thought I read a user report having never opened multiple windows. (which could be incorrect)
Comment 10 Matthias Versen [:Matti] 2012-11-27 07:47:54 PST
*** Bug 815122 has been marked as a duplicate of this bug. ***
Comment 11 Mike Conley (:mconley) - (Needinfo me!) 2012-11-28 06:19:31 PST
Comment on attachment 685204 [details] [diff] [review]
proposed fix

Review of attachment 685204 [details] [diff] [review]:
-----------------------------------------------------------------

Yep - this is what we want. Thanks Richard!
Comment 12 Richard Marti (:Paenglab) 2012-11-28 06:34:14 PST
Comment on attachment 685204 [details] [diff] [review]
proposed fix

[Approval Request Comment]
This made a lot of GS traffic after release of TB 17. To solve this I think it would be best if this could land in the next TB 17 update.
Comment 13 Mark Banner (:standard8) 2012-11-28 07:00:54 PST
https://hg.mozilla.org/comm-central/rev/7a9edeb46df5
Comment 15 depicco 2012-12-03 05:38:40 PST
I would like to clear some points about this, as a user, as I have seen after using it for a while:

Probably a new feature of 'thunderbird 17', or whatever, If there where n windows when you close your thunderbird client, next time you open thunderbird, there will be n windows. If you had 2 windows when closing thunderbird, there will be 2 windows when you open it next time.
Now, what happens if thunderbird opens 2 windows each time you tell your system to open thunderbird.. let's say you open thunderbird, but you, for some reasson, even by accident, you click many times to open thunderbird: it will open many times, but by each time you clicked the thunderbird icon, it will open 2 windows. What does it mean? it means by every time you clicked the icon, you have 2 windows.
Now here comes the fun part: when you close any window, they will all close; but even funnier is that when you open it next time, all of those windows will open next time. Funny isn't it? you can only increase windows number.
Was there any point in restoring the windows number in a mail client? or was there any point that when you close any window, they will all close?
Comment 16 Richard Marti (:Paenglab) 2012-12-03 05:57:08 PST
Depicco,

All you wrote is a result of this bug and should be fixed in the next update. Except what you wrote with multiple times clicking the icon. After opening the first time, and leave them open, a new icon click rises only the window/s into the front.
Comment 17 Richard Marti (:Paenglab) 2012-12-13 01:41:38 PST
*** Bug 821077 has been marked as a duplicate of this bug. ***
Comment 18 Richard Marti (:Paenglab) 2012-12-14 08:08:13 PST
*** Bug 821612 has been marked as a duplicate of this bug. ***
Comment 19 Richard Marti (:Paenglab) 2012-12-14 10:26:22 PST
*** Bug 821793 has been marked as a duplicate of this bug. ***
Comment 20 jdub 2012-12-17 15:49:33 PST
Yes, I had this too. I closed Thunderbird with two tabs. When I started it next time my computer was not responding (maybe busy with another task) so I impatiently clicked the TB desktop icon eight times. When TB finally started, it opened 16 inboxes and clicking the X to close any one, closed them all. Next startup 16 inboxes again.
Comment 21 WADA 2012-12-19 19:58:29 PST
Checked following trunk nightly build on MS Win-XP.
> Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Thunderbird/20.0a1
> Application Build ID : 20121218064339
X button closed single window only, so excess windows were not saved in sessions.json, thus phenomenon of bug 805185 didn't occur any more.
Comment 22 markus.selve@web.de 2014-10-05 01:55:04 PDT
I observed this behaviour again in Thunderbird 31.1.2 on Win XP.
Comment 23 WADA 2014-10-05 02:46:48 PDT
(In reply to markus.selve@web.de from comment #22)
> I observed this behaviour again in Thunderbird 31.1.2 on Win XP.

What do you call by your "this behaviour"?

This bug is for:
(i) Open multiple Messenger Windows(Tb's main 3 pane window) on Win-XP.
     Try to close only one window, by X button in _□X buttons at top/right corner of each window.
     => all multiple windows are closed, so multiple windows are opened again upon restart of Tb by session-restore.
This was Win-XP only problem.

This bug is never for next phenomenon.
(ii) Open multiple Messenger Windows(Tb's main 3 pane window) on any OS.
      Terminate Thunderbird by File/Exit menu.
     => all multiple windows are closed at once, except composition window, 
           and multiple windows are opened upon restart of Tb by session-restore.
This is design of  File/Exit menu of Thunderbird.

markus.selve@web.de, what was your actual operations?
Comment 24 markus.selve@web.de 2014-10-05 03:22:16 PDT
On one click two instances of Thunderbird were opened.  The bug that describes this is marked as fixed by this bug.  I indeed closed via File/Exit menu.  I did not try the X button in the upper right corner.  Instead I circumvented the original bug by closing one of the instances with Alt-F4.  So maybe also the X button in the upper right corner would have closed the superfluous instance.
Do you know how I can re-create the original bug that two instances instead of one open?  I'd then try to close one of them with the X button in the upper right corner to proof that this bug is fixed.

Regards, Markus.
Comment 25 Richard Marti (:Paenglab) 2014-10-05 03:54:10 PDT
Right click on a folder in the left pane and select 'Open in New Window'.
Comment 26 markus.selve@web.de 2014-10-05 04:35:45 PDT
(In reply to Richard Marti (:Paenglab) from comment #25)
> Right click on a folder in the left pane and select 'Open in New Window'.

I can confirm that this works and just one window closed.  So the bug described here is fixed.  I withdraw my statement that I observed the behaviour again.

Thanks, Markus.

Note You need to log in before you can comment on or make changes to this bug.