mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 19:45:09 +00:00
43 lines
765 B
ObjectPascal
43 lines
765 B
ObjectPascal
unit PlatformUtils;
|
|
|
|
{
|
|
PlatformUtils.pas - small helpers for desktop/runtime platform checks.
|
|
}
|
|
|
|
{$IFDEF FPC}
|
|
{$MODE Delphi}
|
|
{$ENDIF}
|
|
|
|
interface
|
|
|
|
function QtPlatformAllowsOpenGLControls: Boolean;
|
|
|
|
implementation
|
|
|
|
uses
|
|
SysUtils;
|
|
|
|
function QtPlatformAllowsOpenGLControls: Boolean;
|
|
var
|
|
Qpa, FirstQpa, SessionType: string;
|
|
Sep: Integer;
|
|
begin
|
|
Result := True;
|
|
Qpa := LowerCase(Trim(GetEnvironmentVariable('QT_QPA_PLATFORM')));
|
|
SessionType := LowerCase(Trim(GetEnvironmentVariable('XDG_SESSION_TYPE')));
|
|
|
|
if Qpa <> '' then
|
|
begin
|
|
FirstQpa := Qpa;
|
|
Sep := Pos(';', FirstQpa);
|
|
if Sep > 0 then
|
|
FirstQpa := Copy(FirstQpa, 1, Sep - 1);
|
|
Result := FirstQpa <> 'wayland';
|
|
Exit;
|
|
end;
|
|
|
|
Result := SessionType <> 'wayland';
|
|
end;
|
|
|
|
end.
|