lcl gtk2: fixed GetControlWindow

git-svn-id: trunk@64050 -
This commit is contained in:
mattias 2020-10-22 14:48:28 +00:00
parent 22c8f47b2a
commit 3e797e6d64
2 changed files with 5 additions and 6 deletions

View File

@ -4067,13 +4067,10 @@ function GetControlWindow(Widget: Pointer) : PGDKWindow;
begin
if Widget <> nil then
begin
If not GTKWidgetIsA(PGTKWidget(Widget), GTK_Layout_Get_Type) then
Result := PGTKWidget(Widget)^.Window
If GTKWidgetIsA(PGTKWidget(Widget), GTK_Layout_Get_Type) then
Result := PGtkLayout(Widget)^.bin_window
else
begin
gtk_widget_realize(Widget); // associate with window
Result := PGtkLayout(Widget)^.bin_window;
end;
Result := PGTKWidget(Widget)^.Window;
if (Result=nil) and (GTK_WIDGET_NO_WINDOW(Widget)) then
Result:=gtk_widget_get_parent_window(Widget);
end else

View File

@ -9411,6 +9411,8 @@ begin
end;
if Widget = nil then
Exit(0);
if GTKWidgetIsA(Widget, GTK_Layout_Get_Type) then
gtk_widget_realize(Widget); // associate with window
Window := GetControlWindow(Widget);
if Window = nil then
Exit(0);