mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:59:13 +02:00
Gtk3: create DC from window if possible.
This commit is contained in:
parent
4f51192d03
commit
f59489a32a
@ -2031,6 +2031,9 @@ begin
|
|||||||
Result := Widget.Context;
|
Result := Widget.Context;
|
||||||
if (Result = 0) then
|
if (Result = 0) then
|
||||||
begin
|
begin
|
||||||
|
if Gtk3IsGdkWindow(Widget.GetWindow) then
|
||||||
|
Result := HDC(TGtk3DeviceContext.Create(Widget.GetWindow, True))
|
||||||
|
else
|
||||||
Result := HDC(TGtk3DeviceContext.Create(Widget.GetContainerWidget, False));
|
Result := HDC(TGtk3DeviceContext.Create(Widget.GetContainerWidget, False));
|
||||||
TGtk3DeviceContext(Result).CanRelease := True;
|
TGtk3DeviceContext(Result).CanRelease := True;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user