mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 19:18:14 +02:00
lcl gtk2: fixed GetControlWindow
git-svn-id: trunk@64050 -
This commit is contained in:
parent
22c8f47b2a
commit
3e797e6d64
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user