Bug 353548 - With multiple tabs open, Dolphin asks to close the window when terminating KDE session
Summary: With multiple tabs open, Dolphin asks to close the window when terminating KD...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-05 06:16 UTC by Nikos Platis
Modified: 2016-01-28 20:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.12.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Platis 2015-10-05 06:16:36 UTC
I routinely use Dolphin with multiple tabs. When I want to logout or shutdown and its window is about to close, the dialog asking "You have multiple tabs open. Do you really want to close the window?" pops up and waits for input, preventing logout or shutdown.


Reproducible: Always

Steps to Reproduce:
1. Open a Dolphing window
2. Open some tabs in it
3. Shutdown or logout

Actual Results:  
The dialog asking "You have multiple tabs open. Do you really want to close the window?" pops up and waits for input, preventing logout or shutdown.

Expected Results:  
Dolphin should terminate without asking, in this case.

This happens in version 15.08.1 (which, btw, is not included in the dropdown containing possible versions in the bug report form) and did not happen in the "old" Dolphin. So it must be something related to the port to KF5.
Comment 1 Emmanuel Pescosta 2015-10-07 07:28:04 UTC
> The dialog asking "You have multiple tabs open. Do you really want to close the window?" 
> pops up and waits for input, preventing logout or shutdown.

IMHO this behaviour sounds correct when 'asking for confirmation when Dolphin has multiple tabs open' is enabled, am I wrong?

You can disable it via Settings -> General -> Confirmations ;)
Comment 2 Graham P Davis 2015-11-26 14:13:58 UTC
(In reply to Emmanuel Pescosta from comment #1)
> > The dialog asking "You have multiple tabs open. Do you really want to close the window?" 
> > pops up and waits for input, preventing logout or shutdown.
> 
> IMHO this behaviour sounds correct when 'asking for confirmation when
> Dolphin has multiple tabs open' is enabled, am I wrong?

It is the correct behaviour when manually closing Dolphin - or a similar tabbed application such as Firefox - but I believe it to be incorrect on logging out. It has never been applied is such a way before in Plasma-5 nor in KDE4. Even in KDE3, long before Dolphin was a gleam in anyone's eye, it was not the case with Konqueror. 

> You can disable it via Settings -> General -> Confirmations ;)

Yes, but this would be dangerous as a misstep with the mouse would lead to a windowful of tabs being shut down by accident.
Comment 3 Nikos Platis 2015-12-02 07:24:51 UTC
Let me add that this erroneous behavior also has the following adverse side-effect: Supposing you have chosen to restore the KDE session upon login (which is the default setting, if I remember correctly -- and a very useful one), if you "manually" (have to) close the Dolphin window on logout as per this bug, then this window is not restored the next time you login. 

All this is really unacceptable for something that used to work for years...
Comment 4 Wolfgang Bauer 2015-12-21 09:12:23 UTC
This confirmation dialog on logout is actually because Qt5 incorrectly closes all windows (and as a result quits the application) when asked to store the state by the session management.
See https://bugreports.qt.io/browse/QTBUG-49667

So this is no dolphin bug, nor even a change in dolphin's behaviour really.
Comment 5 Wolfgang Bauer 2016-01-28 12:22:20 UTC
Actually, Dolphin does differentiate in the window close event handler and only asks for confirmation when explicitly closed by the user.

But this check got broken here:
https://quickgit.kde.org/?p=dolphin.git&a=commit&h=c7258487094c7e16258ad90e384c3a87605dfc95

It calls qApp->isSessionRestored() instead of qApp->isSavingSession() to find out whether the window is closed by session management.

Fix:
https://git.reviewboard.kde.org/r/126917/
Comment 6 Graham P Davis 2016-01-28 15:08:02 UTC
A couple of days ago, I went back to try Tumbleweed again. After I installed all the latest updates, I reset the Dolphin setting to its normal one of asking for confirmation when closing tabs. I logged out and found that I no longer got the erroneous warning message.

However, in a subsequent test in another user-session, I created a new Dolphin window with a couple of tabs and tried logging out. In this case, the warning message appeared for the new Dolphin session but not for the half-dozen pre-existing ones.  It may be that saving the KDE session before logging out will prevent the unwanted message but I've not yet tested this due to other more serious Plasma5 problems.

It appears to me as though something has been done [in Qt5?] which almost fixes this bug. I'll add more here when I've been able to do more tests.
Comment 7 Wolfgang Bauer 2016-01-28 15:51:22 UTC
(In reply to Graham P Davis from comment #6)
> It appears to me as though something has been done [in Qt5?] which almost
> fixes this bug. I'll add more here when I've been able to do more tests.

No.
Comment 8 Wolfgang Bauer 2016-01-28 20:05:10 UTC
Git commit bf1dbee1d6a709983d9f5034c61e2f005fdc6aee by Wolfgang Bauer.
Committed on 28/01/2016 at 20:03.
Pushed by wbauer into branch 'Applications/15.12'.

Fix check whether window is closed by session management

qApp->isSessionRestored() specifies whether the application has been
restored by session management. This is obviously wrong here. Use
qApp->isSavingSession() instead.
FIXED-IN: 15.12.2
REVIEW: 126917

M  +1    -1    src/dolphinmainwindow.cpp

http://commits.kde.org/dolphin/bf1dbee1d6a709983d9f5034c61e2f005fdc6aee