LCL-GTK2: Futher fixes for TrayIcon. Issue #36199, patch from David.

git-svn-id: trunk@62124 -
This commit is contained in:
juha 2019-10-26 17:14:21 +00:00
parent f625e656d0
commit a9ffb7fc67

View File

@ -260,40 +260,22 @@ var
Initialized: Boolean; Initialized: Boolean;
function UnityAppIndicatorInit: Boolean; function UnityAppIndicatorInit: Boolean;
var
Module: HModule;
UseAppInd : string;
function NeedAppIndicator: boolean;
var var
Module: HModule; DeskTop : String;
UseAppInd : string; begin
DeskTop := GetEnvironmentVariableUTF8('XDG_CURRENT_DESKTOP');
function NeedAppIndicator: boolean; // See the wiki for details of what extras these desktops require !!
var if (Desktop = 'GNOME')
DeskTop, VersionSt : String; or (DeskTop = 'Unity')
ProcFile: TextFile; or (Desktop = 'Enlightenment')
begin or (Desktop = 'ubuntu:GNOME') then exit(True);
DeskTop := GetEnvironmentVariableUTF8('XDG_CURRENT_DESKTOP'); Result := False;
// See the wiki for details of what extras these desktops require !! end;
if (DeskTop = 'Unity')
or (Desktop = 'Enlightenment')
then exit(True);
if (DeskTop = 'GNOME') then begin
{$PUSH}
{$IOChecks off}
AssignFile(ProcFile, '/proc/version');
reset(ProcFile);
if IOResult<>0 then exit(false);
{$POP}
readln(ProcFile, VersionSt);
CloseFile(ProcFile);
if ( (pos('mageia', VersionSt) > 0) or
(pos('Debian', VersionSt) > 0) or
(pos('Red Hat', VersionSt) > 0) or
(pos('SUSE', VersionSt) > 0) )
// 19.04 and earlier Ubuntu Gnome does not need LibAppIndicator3
then exit(True);
end;
Result := False;
end;
function TryLoad(const ProcName: string; var Proc: Pointer): Boolean; function TryLoad(const ProcName: string; var Proc: Pointer): Boolean;
begin begin