Gtk3: create DC from window if possible.

This commit is contained in:
zeljan1 2025-01-14 10:25:44 +01:00
parent 4f51192d03
commit f59489a32a

View File

@ -2031,7 +2031,10 @@ begin
Result := Widget.Context;
if (Result = 0) then
begin
Result := HDC(TGtk3DeviceContext.Create(Widget.GetContainerWidget, False));
if Gtk3IsGdkWindow(Widget.GetWindow) then
Result := HDC(TGtk3DeviceContext.Create(Widget.GetWindow, True))
else
Result := HDC(TGtk3DeviceContext.Create(Widget.GetContainerWidget, False));
TGtk3DeviceContext(Result).CanRelease := True;
end;
end else