function IsWayland: Boolean;
var
APlatform: WideString;
begin
Result := False;
QGuiApplication_platformName(@APlatform);
Result := APlatform = 'wayland';
// not QX11Info_isPlatformX11() and (GetEnvironmentVariable('XDG_SESSION_TYPE') = 'wayland');
end;
Can we cache the function res to a global variable, ie call the function only once? Now it's called 100 times from different places of Qt5 WS.