-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.14.0, 5.15.0 Beta3
-
None
Qt XCB apps get two "do you want to save changes" prompts on logout since 1b6db1849477be30ef0ca52c288d358b911ea1e4
On X previously the shutdown system would be as follows:
1) we receive sm_performSaveYourself. This emits QGuiApplication::commitDataRequest
2) we receive sm_dieCallback this creates a quitEvent, which QCoreApplication handles and quits
Since the patch that became effectively:
1) we receive sm_performSaveYourself. This emits QGuiApplication::commitDataRequest
2) we receive sm_dieCallback this creates a quitEvent, which QApplication handles and iterate through windows closing them.
It is standard practice for an app to show a "do you want to save changes" prompt on commitDataRequest, where the QSessionManager is exposed and we can reply. We should not close windows at this step as some other client could cancel the shutdown. It is also common to show the prompt in QWindow::closeEvent of main windows, to capture the user closing the window through the window manager.
Qt's own demo app in examples/widgets/mainwindows/application does exactly this.
Running this against an X11 session manager such as ksmserver from KDE Plasma, making a change and triggering a logout will result in the two prompts.
-------
As a fast fix can we add a if(platformName() == "osx") round the new behaviour?
Then do something properly for Qt6, such as a hint in the closeEvent as to why we're closing.