You can't just send fake close events to clients that don't expect that. That... technique... is a KDE specialty. KDE applications are written to deal with it. In the general case, though, it is legitimate to start destroying internal data structures in a close event, and it is legitimate not to expect more than one close event before the window is actually closed. Case in point: fixing KMainWindow and KApplication to restore their KDE4 behavior (I have locally tested Qt and KDE patches to that effect) makes Kate crash on logout.
Changing behavior but not API is *worse* than adding API that optionally changes behavior - it silently breaks expectations of existing software. We can, however, implement a workaround in KDE (and then fix our stuff when something breaks): At the end of the slot handling commitDataRequest(), install an event filter on the QGuiApplication, which nicely filters ALL events to everything (TODO: check that - otherwise we'd just install an event filter on all toplevel windows). In that filter, check whether QGuiApplication::isSavingSession() is still true: if so, filter out and ignore() all CloseEvents. If not, have the the filter uninstall and delete itself for performance reasons. If you look at QWidgetPrivate::close_helper(), you see that it always sends a close event to ask windows if they agree to be closed, and they can always refuse. Now which repository should that go in? It would be ugly to copy and paste the necessary code around - it should be roughly ten lines. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to qtbase-opensource-src in Ubuntu. https://bugs.launchpad.net/bugs/1446865 Title: KDE5/Qt5 does not support session restoration Status in KDE Base Workspace: Confirmed Status in Qt: New Status in plasma-workspace package in Ubuntu: Confirmed Status in qtbase-opensource-src package in Ubuntu: Confirmed Bug description: KDE5/Qt5 does not support proper session restoration. ProblemType: Bug DistroRelease: Ubuntu 15.10 To manage notifications about this bug go to: https://bugs.launchpad.net/kdebase-workspace/+bug/1446865/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp