LCL-Gtk2: Avoid Gtk-CRITICAL warnings on Linux, issue #41611.

Avoid warnings like:
(project1:153785): Gtk-CRITICAL **: 09:35:29.899:
IA__gtk_paint_flat_box: assertion 'style->depth ==
gdk_drawable_get_depth (window)' failed

This is a regression after commit
3185572fdf, which fixed crash on OpenBSD
(issue #41244).

Now the change from the above commit is active only for the OpenBSD
platform.
This commit is contained in:
Maxim Ganetsky 2025-05-06 01:36:50 +03:00
parent 30dd771375
commit d611e0c2a3
2 changed files with 6 additions and 0 deletions

View File

@ -8185,7 +8185,11 @@ begin
WidgetName := 'gtk-tooltip-lcl';
StyleObject^.Owner := Tp;
Tp := nil;
// The following line causes `Gtk-CRITICAL` warning on Linux, issue #41611.
// It seems to be only needed on OpenBSD, issue #41244.
{$IF DEFINED(OPENBSD)}
AddToStyleWindow:=false;
{$ENDIF}
end
else
If CompareText(WName,LazGtkStyleNames[lgsHScale])=0 then begin

View File

@ -263,6 +263,7 @@ begin
BP_PUSHBUTTON:
begin
Result.Widget := GetStyleWidget(lgsButton);
// style is always overwritten to lgsButton to avoid problems with TSpeedButton color, issue #22901
Result.Style := GetStyle(lgsButton);
Result.State := GtkButtonMap[Details.State];
if Details.State = PBS_PRESSED then
@ -482,6 +483,7 @@ begin
end;
teToolTip:
begin
// style is always overwritten to avoid problems with theming, issue #41611
Result.Style := GetStyle(lgsTooltip);
Result.Widget := GetStyleWidget(lgsTooltip);
Result.State := GTK_STATE_NORMAL;