Export the really used platform in env variable QT_QPA_FLATPAK_PLATFORM
ClosedPublic

Authored by graesslin on Oct 9 2017, 3:36 PM.

Details

Summary

Flatpak applications use the platformName "flatpak". But in truth they
use the actual platform "xcb" or "wayland". Due to the name change to
flatpak libraries and applications checking for the platform will not
recognize correctly and not load the integration. E.g.
KWindowSystem::isPlatformX11 returns false even if it is on xcb and
KWindowSystem::isPlatformWayland returns false even if it is on Wayland.

By exporting the actual platform in the env variable KWindowSystem can
be adjusted to check whether the platformName is "flatpak" and do a
custom handling without much effort. Thus all further software relying
on KWindowSystem to get it right, will just work.

The patch for KWindowSystem to support this is already prepared.

Test Plan

KWindowSystem loaded the correct integration

Diff Detail

Repository
R837 Flatpak Platform Plugin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Oct 9 2017, 3:36 PM
apol added a comment.Oct 9 2017, 3:40 PM

I don't have an issue with it. +1

That said, it's a workaround as QX11Info::isPlatformX11() will stay broken.

This and the patch in KWindowSystem hopefully won't be needed in future once https://codereview.qt-project.org/#/c/202746/ is done. We should at least for now backport this patch to our runtimes to make everything work.

This and the patch in KWindowSystem hopefully won't be needed in future once https://codereview.qt-project.org/#/c/202746/ is done. We should at least for now backport this patch to our runtimes to make everything work.

I don't see this patch moving forward much (not your fault). Given that I suggest to go for a short term solution and make this actually work. Yes it's a problem that QX11Info::isPlatformX11 won't work, but I care about Wayland :-P

apol accepted this revision.Oct 9 2017, 4:14 PM

Let's get it in altogether and when we remove the QPA this code will go with it.

This revision is now accepted and ready to land.Oct 9 2017, 4:14 PM
This revision was automatically updated to reflect the committed changes.