mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 13:39:30 +02:00
Gtk2: better recognition of wayland session, do not create dummy frame.
(cherry picked from commit 54ba042fb2
)
Co-authored-by: Željan Rikalo <zeljko@lazarus-ide.org>
This commit is contained in:
parent
6739c59336
commit
1b2d86714b
@ -76,6 +76,9 @@ type
|
||||
{$IFNDEF USE_GTK_MAIN_OLD_ITERATION}
|
||||
FMainPoll: PGPollFD;
|
||||
{$ENDIF}
|
||||
{$IFDEF HASX}
|
||||
FIsWayland: boolean;
|
||||
{$ENDIF}
|
||||
FIsLibraryInstance: Boolean;
|
||||
FGtkTerminated: Boolean;
|
||||
FMultiThreadingEnabled: boolean;
|
||||
@ -315,6 +318,7 @@ type
|
||||
function GetDesktopWidget: PGtkWidget;
|
||||
//function X11Raise(AHandle: HWND): boolean; currently not used
|
||||
function GetWindowManager: String;
|
||||
function IsWayland: boolean;
|
||||
function IsCurrentDesktop(AWindow: PGdkWindow): Boolean;
|
||||
function X11GetActiveWindow: HWND;
|
||||
function GetAlwaysOnTopX11(AWindow: PGdkWindow): boolean;
|
||||
|
@ -1531,6 +1531,11 @@ begin
|
||||
|
||||
FIsLibraryInstance := False;
|
||||
FGtkTerminated := False;
|
||||
{$IFDEF HASX}
|
||||
FIsWayland := UTF8LowerCase(GetEnvironmentVariableUTF8('XDG_SESSION_TYPE')) = 'wayland';
|
||||
{$ELSE}
|
||||
FIsWayland := False;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF EnabledGtkThreading}
|
||||
{$IFNDEF Win32}
|
||||
@ -1931,7 +1936,7 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
WM := GetWindowManager;
|
||||
if (WM = '') or (WM = 'wayland') then
|
||||
if (WM = '') or (WM = 'wayland') or IsWayland then
|
||||
exit;
|
||||
ADummy := TDummyWidget.Create;
|
||||
ADummy.ShowDummyWidget(ALeft, ATop, AWidth, AHeight);
|
||||
@ -4630,6 +4635,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TGtk2WidgetSet.IsWayland: boolean;
|
||||
begin
|
||||
Result := FIsWayland;
|
||||
end;
|
||||
|
||||
function TGtk2WidgetSet.X11GetActiveWindow: HWND;
|
||||
var
|
||||
Display: PDisplay;
|
||||
|
@ -425,7 +425,7 @@ begin
|
||||
end;
|
||||
|
||||
{$IFDEF HASX}
|
||||
if (AWinControl = Application.MainForm) and
|
||||
if (AWinControl = Application.MainForm) and not Gtk2WidgetSet.IsWayland and
|
||||
not Application.HasOption('disableaccurateframe') then
|
||||
Gtk2WidgetSet.CreateDummyWidgetFrame(-1, -1, -1, -1);
|
||||
{$ENDIF}
|
||||
|
Loading…
Reference in New Issue
Block a user