SUMMARY *** Warning dialogue recurs after cancelling *** STEPS TO REPRODUCE 1. Create a file 'Kate' or 'Kwrite' and enter text 'this is a text'. 2. Save the file. 3. Type some more. 4. Quit the application 5. Click Cancel ONE TIME. OBSERVED RESULT Dialog returns, very slightly altered in shape - but with identical text and options. EXPECTED RESULT After clicking Cancel, the dialog should not re-appear. SOFTWARE/OS VERSIONS Operating System: Manjaro Linux KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.105.0 Qt Version: 5.15.9 Kernel Version: 6.3.0-1-MANJARO (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 5600G with Radeon Graphics Memory: 15.0 GiB of RAM Graphics Processor: AMD Radeon Graphics Product Name: B550M Steel Legend
Created attachment 158903 [details] Kate-Kwrite dialog in question file:///home/ben/Desktop/Kate-Kwrite-Bug.png
Can reproduce.
Happens for Ctrl+Q or when clicking the window's close button, but not when closing just one document with Ctrl+W or its tab's close button.
Tried to bisect but was unable to succeed because at a certain point the kate repo stopped compiling. Did a bit of debugging in KateApp::shutdownKate() but got lost after a while. My current theory is that the quit signal is being handled by something else and blocking the first quit, but that's just an educated guess at this point. Probably need the Kate developers to take over from here.
Yeah, that is a bad thing but I missed to track back how or why it is broken, too :(
Pasting my message from a weeks ago in kate chat room about this; re the double dialog issue on Ctrl+Q. It is handled by KateApp::shutdownKate, The first dialog is a result of: if (!win->queryClose_internal()) { return; } and the second: QApplication::quit(); ... #8 0x7ff30f88fe9c in KateMainWindow::queryClose() kde/src/utilities/kate/apps/lib/katemainwindow.cpp:687:9 #9 0x7ff30d9ba6de in KMainWindow::closeEvent(QCloseEvent*) kde/src/frameworks/kxmlgui/src/kmainwindow.cpp:538:9 ... #31 0x7ff30f794c4c in KateApp::shutdownKate(KateMainWindow*)kde/src/utilities/kate/apps/lib/kateapp.cpp:486:5 I think the behaviour changed somewhere in Qt6
Indeed, it did change, sometimes RTFM helps :-) https://invent.kde.org/utilities/kate/-/merge_requests/1305
Though this bug says Qt 5.15. So something else is broken, too?
Git commit 1949852afa14f4c479ca96e85cec3661d454efad by Christoph Cullmann, on behalf of Kai Uwe Broulik. Committed on 20/09/2023 at 10:49. Pushed by cullmann into branch 'master'. Explicitly call QCoreApplication::exit() > In Qt 5, QCoreApplication::quit() was equivalent to calling QCoreApplication::exit(). > This just exited the main event loop. > In Qt 6, the method will instead try to close all top-level windows by posting a close event. > The windows are free to cancel the shutdown process by ignoring the event. > Call QCoreApplication::exit() to keep the non-conditional behavior. Kate already does its own cleanup and close handling when the event loop exits, now leading to double prompts when Qt sends a close event and then Kate tries to close them. Instead, just call `exit()`. M +3 -3 apps/kate/katewaiter.cpp M +5 -1 apps/lib/kateapp.cpp https://invent.kde.org/utilities/kate/-/commit/1949852afa14f4c479ca96e85cec3661d454efad
Git commit a03c5190fb1b2202d684674b7ed32f6a05388042 by Christoph Cullmann, on behalf of Kai Uwe Broulik. Committed on 20/09/2023 at 11:09. Pushed by cullmann into branch 'release/23.08'. Explicitly call QCoreApplication::exit() > In Qt 5, QCoreApplication::quit() was equivalent to calling QCoreApplication::exit(). > This just exited the main event loop. > In Qt 6, the method will instead try to close all top-level windows by posting a close event. > The windows are free to cancel the shutdown process by ignoring the event. > Call QCoreApplication::exit() to keep the non-conditional behavior. Kate already does its own cleanup and close handling when the event loop exits, now leading to double prompts when Qt sends a close event and then Kate tries to close them. Instead, just call `exit()`. (cherry picked from commit 1949852afa14f4c479ca96e85cec3661d454efad) M +3 -3 apps/kate/katewaiter.cpp M +5 -1 apps/lib/kateapp.cpp https://invent.kde.org/utilities/kate/-/commit/a03c5190fb1b2202d684674b7ed32f6a05388042
The cherry picked comment doesn't match, but it might fix the issue.
Should it already be fixed in 23.08.2? If so, it's still not fixed.
Looks like the cause of this bug is https://invent.kde.org/utilities/kate/-/commit/99b98212e4d00ce75015e535ea5ea3cc4e227366. Can you look?
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1363
*** Bug 477173 has been marked as a duplicate of this bug. ***
Git commit 4a9110d662cc3d2cdd90561d9803a7655a1a5721 by Christoph Cullmann, on behalf of Eugene Popov. Committed on 27/11/2023 at 18:57. Pushed by cullmann into branch 'master'. Avoid asking the user twice for required actions when closing a window M +2 -3 apps/lib/katemainwindow.cpp https://invent.kde.org/utilities/kate/-/commit/4a9110d662cc3d2cdd90561d9803a7655a1a5721
*** Bug 482545 has been marked as a duplicate of this bug. ***