mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-22 06:00:26 +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;
|
AHeight: integer): boolean;
|
||||||
var
|
var
|
||||||
ADummy: TDummyWidget;
|
ADummy: TDummyWidget;
|
||||||
|
WM: String;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
WM := GetWindowManager;
|
||||||
|
if (WM = '') or (WM = 'wayland') then
|
||||||
|
exit;
|
||||||
ADummy := TDummyWidget.Create;
|
ADummy := TDummyWidget.Create;
|
||||||
ADummy.ShowDummyWidget(ALeft, ATop, AWidth, AHeight);
|
ADummy.ShowDummyWidget(ALeft, ATop, AWidth, AHeight);
|
||||||
FWSFrameRect := ADummy.GetWidgetFrame;
|
FWSFrameRect := ADummy.GetWidgetFrame;
|
||||||
@ -4584,7 +4588,7 @@ begin
|
|||||||
@unused, @data) = Success then
|
@unused, @data) = Success then
|
||||||
begin
|
begin
|
||||||
if (typeReturned = WMAtom) and (formatReturned = 8) then
|
if (typeReturned = WMAtom) and (formatReturned = 8) then
|
||||||
Result := LowerCase(StrPas(PWideChar(Data)));
|
Result := LowerCase(StrPas(PChar(Data)));
|
||||||
if Data <> nil then
|
if Data <> nil then
|
||||||
XFree(Data);
|
XFree(Data);
|
||||||
Data := nil;
|
Data := nil;
|
||||||
@ -6610,9 +6614,9 @@ begin
|
|||||||
if Result then
|
if Result then
|
||||||
begin
|
begin
|
||||||
if Gtk2WidgetSet.compositeManagerRunning then
|
if Gtk2WidgetSet.compositeManagerRunning then
|
||||||
AMaxLoops := 200000
|
AMaxLoops := 100000
|
||||||
else
|
else
|
||||||
AMaxLoops := 20000;
|
AMaxLoops := 10000;
|
||||||
{$IFDEF DEBUGGTK2FRAMESIZE}
|
{$IFDEF DEBUGGTK2FRAMESIZE}
|
||||||
writeln('ShowDummyWidget(start) WindowManager="',Gtk2WidgetSet.GetWindowManager,'" Compositing enabled="',Gtk2WidgetSet.compositeManagerRunning,'" IsWayland="UNKNOWN" MaxLoops=',AMaxLoops);
|
writeln('ShowDummyWidget(start) WindowManager="',Gtk2WidgetSet.GetWindowManager,'" Compositing enabled="',Gtk2WidgetSet.compositeManagerRunning,'" IsWayland="UNKNOWN" MaxLoops=',AMaxLoops);
|
||||||
ATicks := GetTickCount64;
|
ATicks := GetTickCount64;
|
||||||
|
Loading…
Reference in New Issue
Block a user