Recent

Author Topic: IsWayland value can be cached  (Read 765 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2488
    • UVviewsoft
IsWayland value can be cached
« on: December 02, 2023, 10:11:17 pm »
Code: Pascal  [Select][+][-]
  1. function IsWayland: Boolean;
  2. var
  3.   APlatform: WideString;
  4. begin
  5.   Result := False;
  6.   QGuiApplication_platformName(@APlatform);
  7.   Result := APlatform = 'wayland';
  8.   // not QX11Info_isPlatformX11() and (GetEnvironmentVariable('XDG_SESSION_TYPE') = 'wayland');
  9. 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.

 

TinyPortal © 2005-2018