[Touch-packages] [Bug 1446865]
Git commit 58e49487aece3de19aae90bbb9b80cd5aab94d04 by Andreas Hartmetz. Committed on 19/02/2016 at 18:55. Pushed by ahartmetz into branch 'master'. Fix session management for KApplication based applications. - Call QGuiApplication::setFallbackSessionManagementEnabled(false) to prevent premature application exit - Wire up the saveStateRequest() and commitDataRequest() signals to the appropriate methods that had to be turned into slots first. Those methods were never even called, they were not ported properly. - Cancel logout when the user decides to do that. A comment in the code was not sufficient to do that. (?!?!) M +16 -1src/kdeui/kapplication.cpp M +15 -14 src/kdeui/kapplication.h http://commits.kde.org/kdelibs4support/58e49487aece3de19aae90bbb9b80cd5aab94d04 -- 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: Fix Released 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
[Touch-packages] [Bug 1446865]
Git commit f7cbcc77722256db084d3b0ab6ce76173e959f0e by Andreas Hartmetz. Committed on 19/02/2016 at 18:49. Pushed by ahartmetz into branch 'master'. Fix session management broken since KF5 / Qt5. Requires Qt 5.6 branch not more than a few days old, or >= 5.6.0 when it is released. Parts of the fix are: - Call QGuiApplication::setFallbackSessionManagementEnabled(false) to prevent application suicide through a mechanism that tries to help applications without any proper session management support, but badly interferes with applications that do implement proper session management, such as KDE applications. - Add back commitData[Request] handling. For some reason it was removed during porting. - Change the returned types of saveState() and commitData() to void. The return values were unused. M +41 -3src/kmainwindow.cpp M +2-1src/kmainwindow_p.h http://commits.kde.org/kxmlgui/f7cbcc77722256db084d3b0ab6ce76173e959f0e -- 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: Fix Released 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
[Touch-packages] [Bug 1446865]
Git commit a08befeac43647e222f48dfd7bed067be81573c4 by Andreas Hartmetz. Committed on 19/02/2016 at 19:08. Pushed by ahartmetz into branch 'master'. KNotes: fix session save / restore. Requires Qt >= 5.6.0 or recent 5.6 branch. M +3-0knotes/src/apps/knotesapp.cpp http://commits.kde.org/kdepim/a08befeac43647e222f48dfd7bed067be81573c4 -- 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: Fix Released 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
[Touch-packages] [Bug 1446865]
..and frankly, I don't feel like gold-plating the solution to this mess. It's not going to be pretty either way, nobody cares too much except when their stuff breaks (ours did), and there are many people to convince to effect really big changes. There is bigger fish to fry. -- 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
[Touch-packages] [Bug 1446865]
Created attachment 96914 Fix session saving / KMainWindow changes -- 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
[Touch-packages] [Bug 1446865]
Created attachment 96913 Fix session saving / KApplication changes -- 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
[Touch-packages] [Bug 1446865]
These patches mostly fix session saving (and therefore restoring), together with the necessary Qt patch. Applications not using KApplication or KMainWindow will need to call QSessionManager::setAutoCloseWindowsEnabled(false) themselves. There a some processes like that in your average KDE session but the patches are trivial so I'm not posting them. -- 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
[Touch-packages] [Bug 1446865]
I don't think that either dynamic properties or changing behavior that has been pretty much proven to be not broken by being around for over 10 years with no complaints will fly upstream, and I don't think they are a very good idea myself. For Qt5, an application attribute might be a good idea. For Qt6, I don't know. I mean there is the small problem that pseuso-SM for applications that think ignoring SM is fine only works if it asks absolutely nothing from applications. An application attribute might even work there as well: if you do care about SM, you have let's say at least 20 lines to write so you can live with another trivial one. -- 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
[Touch-packages] [Bug 1446865]
Those patches are just what I currently have, they are just intended to show the important logic changes. I wasn't really planning to even submit them for review because unfortunately I seem to be the expert on session management. It seems pretty clear that applications either largely expect KDE4 behavior through old APIs, which the patches restore, or they don't but still expect not to get killed for no good reason. The solution there is clear as well. -- 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
[Touch-packages] [Bug 1446865]
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
[Touch-packages] [Bug 1446865]
We cannot change Qt in a way that breaks existing applications. Qt5 has not exactly just been released, and commercial customers value stability very much. Some of them even pay for Qt licenses, which is good for all Qt users, so really, we should not make things worse for them. -- 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
[Touch-packages] [Bug 1446865]
Yes indeed, it doesn't work because ignoring close events cancels logout. Damn. -- 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
[Touch-packages] [Bug 1446865]
(In reply to Thomas Lübking from comment #13) > Andreas, the Qt patch kills the ability to cancel the logout process (when > the process or user prevents closing a window), I'm not sure it will be > accepted and if, you probably will have caused a feature breakage. See > comment #8. Instead of actually closing, the system likely wants to ask > whether anyone is ok with closing this window (ie. cause close events w/o > actually closing the window) How session management works is that the application connects to the QGuiApplication::saveStateRequest() signal. When that signal arrives, the application either saves its state or calls QSessionManager::cancel() on the instance passed in the signal. Session management never works by just trying to close windows without telling the application that it was triggered by session management. In the absence of any proper mechanism, one *could* do it that way, but it's a bad idea because relevant information and actions are not available to the application that way. -- 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: Won't Fix Status in Qt: New Status in plasma-workspace package in Ubuntu: Confirmed Status in qtbase-opensource-src package in Ubuntu: New 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
[Touch-packages] [Bug 1446865]
In reply to comment 7: Yes, that looks like a working monkey patch :) I'm trying to get this https://codereview.qt-project.org/#/c/142232/ merged to fix the bug properly. I'm also looking at a preliminary fix in ksmserver, but I'm not sure if I understand sub-session support, and on a related note if sub-session support as currently implemented is worth keeping. It does not seem to work very well... -- 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: Won't Fix Status in Qt: New Status in plasma-workspace package in Ubuntu: Confirmed Status in qtbase-opensource-src package in Ubuntu: New 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
[Touch-packages] [Bug 1446865]
How should that be done, sending close events and expecting applications to save their state in response, but not close windows or the application? It would mean that applications are session management aware but don't use the session management API and implement a very crude version of session management. A stupid thing to do. I think the only choice here is to break session management in applications that actually support it, or break session management in applications that don't (properly) support it, where it may or may not work semi-accidentally. And let's face it, the only Qt applications that really care about session management and do it correctly are X applications, most of which are KDE applications. Something tells me that those are going to be fine. -- 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: Won't Fix Status in Qt: New Status in plasma-workspace package in Ubuntu: Confirmed Status in qtbase-opensource-src package in Ubuntu: New 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
[Touch-packages] [Bug 1446865]
Note: sub-session support in the session manager is basically support for activities. Session restore of activities has never worked well enough to be useful for me. -- 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: Won't Fix Status in Qt: New Status in plasma-workspace package in Ubuntu: Confirmed Status in qtbase-opensource-src package in Ubuntu: New 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
[Touch-packages] [Bug 1446865]
The session manager getting an OK means asking the client and at this point the client can cancel the shutdown, or save its state and wait to get killed. -- 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: Won't Fix Status in Qt: New Status in plasma-workspace package in Ubuntu: Confirmed Status in qtbase-opensource-src package in Ubuntu: New 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