Qt: added IsWayland helper routine

git-svn-id: trunk@51907 -
This commit is contained in:
zeljko 2016-03-10 18:46:17 +00:00
parent 565dc69ebc
commit 9309190166
2 changed files with 8 additions and 0 deletions

View File

@ -252,6 +252,7 @@ type
function GetQtVersion: String;
function QtVersionCheck(const AMajor, AMinor, AMicro: Integer): Boolean;
{$IFDEF HASX11}
function IsWayland: Boolean; {this is not X11 but wayland !}
function IsCurrentDesktop(AWidget: QWidgetH): Boolean;
function X11Raise(AHandle: HWND): boolean;
function X11GetActiveWindow: QWidgetH;

View File

@ -1,10 +1,17 @@
{%MainUnit qtint.pp}
function IsWayland: Boolean;
begin
Result := GetEnvironmentVariable('XDG_SESSION_TYPE') = 'wayland';
end;
function IsOldKDEInstallation: Boolean;
var
Display: PDisplay;
i: longint;
begin
if IsWayland then
exit(False);
//if we are under KDE4, it's already recent one.
Result := not ((GetEnvironmentVariable('KDE_SESSION_VERSION') = '4') or
(GetEnvironmentVariable('KDE_SESSION_VERSION') = '5')