Gtk3: fixed GetDC()

This commit is contained in:
zeljan1 2025-01-14 09:55:14 +01:00
parent 31fd0ce4f3
commit f7215ec61b

View File

@ -2029,8 +2029,11 @@ begin
begin
Widget := TGtk3Widget(hWnd);
Result := Widget.Context;
if Result = 0 then
Result := HDC(Gtk3DefaultContext);
if (Result = 0) then
begin
Result := HDC(TGtk3DeviceContext.Create(Widget.GetContainerWidget, False));
TGtk3DeviceContext(Result).CanRelease := True;
end;
end else
Result := HDC(Gtk3ScreenContext);
end;
@ -2045,14 +2048,6 @@ begin
OriginDiff);
end;
function TGtk3WidgetSet.GetDesignerDC(WindowHandle: HWND): HDC;
begin
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
DebugLn('WARNING: TGtk3WidgetSet.GetDesignerDC not implemented ...');
{$ENDIF}
Result:=inherited GetDesignerDC(WindowHandle);
end;
function TGtk3WidgetSet.GetDeviceCaps(DC: HDC; Index: Integer): Integer;
var
pscr: PGdkScreen;