mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 19:40:19 +02:00
Gtk2: do not create dummy widget if WM name is empty, also reduce looping on slow systems. issue #40413
(cherry picked from commit e2f0b349f4
)
This commit is contained in:
parent
ba08c94b54
commit
0cc1dc98eb
@ -1895,8 +1895,12 @@ function TGtk2WidgetSet.CreateDummyWidgetFrame(const ALeft, ATop, AWidth,
|
||||
AHeight: integer): boolean;
|
||||
var
|
||||
ADummy: TDummyWidget;
|
||||
WM: String;
|
||||
begin
|
||||
Result := False;
|
||||
WM := GetWindowManager;
|
||||
if (WM = '') or (WM = 'wayland') then
|
||||
exit;
|
||||
ADummy := TDummyWidget.Create;
|
||||
ADummy.ShowDummyWidget(ALeft, ATop, AWidth, AHeight);
|
||||
FWSFrameRect := ADummy.GetWidgetFrame;
|
||||
@ -4584,7 +4588,7 @@ begin
|
||||
@unused, @data) = Success then
|
||||
begin
|
||||
if (typeReturned = WMAtom) and (formatReturned = 8) then
|
||||
Result := LowerCase(StrPas(PWideChar(Data)));
|
||||
Result := LowerCase(StrPas(PChar(Data)));
|
||||
if Data <> nil then
|
||||
XFree(Data);
|
||||
Data := nil;
|
||||
@ -6610,9 +6614,9 @@ begin
|
||||
if Result then
|
||||
begin
|
||||
if Gtk2WidgetSet.compositeManagerRunning then
|
||||
AMaxLoops := 200000
|
||||
AMaxLoops := 100000
|
||||
else
|
||||
AMaxLoops := 20000;
|
||||
AMaxLoops := 10000;
|
||||
{$IFDEF DEBUGGTK2FRAMESIZE}
|
||||
writeln('ShowDummyWidget(start) WindowManager="',Gtk2WidgetSet.GetWindowManager,'" Compositing enabled="',Gtk2WidgetSet.compositeManagerRunning,'" IsWayland="UNKNOWN" MaxLoops=',AMaxLoops);
|
||||
ATicks := GetTickCount64;
|
||||
|
Loading…
Reference in New Issue
Block a user