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.