GTK3: Passed handle of hint win control to WS inside hint data pointer.

Closes #40331.

GTK3 WS needs to get that handle in order to retrieve the parent window
which need to be set as transient of the newly created popup window.

This is a required by GTK3 documentation as one can see in
  https://docs.gtk.org/gtk3/method.Window.set_transient_for.html

This patch needs to touch common LCL code, but `HintData` files does
not seem to be really used.
This commit is contained in:
Abou Al Montacir 2023-06-24 09:53:26 +02:00 committed by Maxim Ganetsky
parent a040ab2201
commit 06ec2750ca
2 changed files with 16 additions and 0 deletions

View File

@ -848,6 +848,7 @@ begin
Visible := False;
Caption := '';
AutoHide := False;
HintData := Pointer((FHintControl as TWinControl).Handle);
end;
end;

View File

@ -814,6 +814,7 @@ type
TGtk3HintWindow = class(TGtk3Window)
private
procedure InitializeWidget; override;
protected
function CreateWidget(const {%H-}Params: TCreateParams):PGtkWidget; override;
end;
@ -7896,6 +7897,20 @@ begin
end;
procedure TGtk3HintWindow.InitializeWidget;
var
ParentWidget: TGtk3Widget;
begin
inherited;
with LCLObject as THintWindow do begin
if Assigned(HintData) then begin
ParentWidget := TGtk3Widget(HintData);
FWidget^.realize;
GetWindow^.set_transient_for(ParentWidget.GetWindow);
end;
end;
end;
{ TGtk3Dialog }
procedure TGtk3Dialog.SetCallbacks;