mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 01:28:19 +02:00
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:
parent
a040ab2201
commit
06ec2750ca
@ -848,6 +848,7 @@ begin
|
||||
Visible := False;
|
||||
Caption := '';
|
||||
AutoHide := False;
|
||||
HintData := Pointer((FHintControl as TWinControl).Handle);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user