I’m trying out a way to achieve the window restore for Qt6 apps on
Plasma

https://invent.kde.org/plasma/plasma-integration/-/merge_requests/254

At this stage, I think I can say that the situation is as follows:
* The server-side implementation of kwin is working
* Qt 6.12 implements the protocol and has its own session manager, but one 
piece is missing: there is no setter to pass the session ID to the session 
manager; as far as I understand, the only way is via the -session command-line 
parameter.
* MR gets round the problem by replacing the backend created by Qt

auto *manager = static_cast<QSessionManagerPrivate 
*>(QObjectPrivate::get(application->session_manager));
            auto *previous = manager->platformSessionManager;
            // Qt 6.12 has no public session-ID setter. Replace the native 
backend
            // before the first xdg_toplevel is associated with it.
            manager->platformSessionManager = 
application->platformIntegration()->createPlatformSessionManager(savedId, 
qApp->sessionKey());
            delete previous;

The patch works for all Qt6 applications that define a windowRole;
consequently, many do not restore the position, but this is an issue
that will need to be resolved by the clients. In any case, many KDE apps
do this, via KMainWindow. I’ve tested Dolphin, Konsole, Kdenlive, etc.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/335761

Title:
  Placement policy 'Remember' by default for all windows

To manage notifications about this bug go to:
https://bugs.launchpad.net/kubuntu-default-settings/+bug/335761/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to