gtk intf: removed cache for windowfrompoint, it crashes if widget was destroyed

git-svn-id: trunk@21200 -
This commit is contained in:
mattias 2009-08-12 15:10:44 +00:00
parent 898ed6eb2d
commit 16af7e11b4
3 changed files with 4 additions and 10 deletions

View File

@ -131,10 +131,6 @@ type
FDragImageListIcon: PGtkWidget; FDragImageListIcon: PGtkWidget;
FDragHotStop: TPoint; FDragHotStop: TPoint;
// cache for WindowFromPoint
FLastWFPMousePos: TPoint;
FLastWFPResult: HWND;
function CreateThemeServices: TThemeServices; override; function CreateThemeServices: TThemeServices; override;
function GetDeviceContextClass: TGtkDeviceContextClass; virtual; abstract; function GetDeviceContextClass: TGtkDeviceContextClass; virtual; abstract;
public public

View File

@ -181,8 +181,6 @@ begin
inherited Create; inherited Create;
FLastWFPMousePos := Point(MaxInt, MaxInt);
{$IFDEF EnabledGtkThreading} {$IFDEF EnabledGtkThreading}
{$IFNDEF Win32} {$IFNDEF Win32}
if GetThreadManager(TM) and Assigned(TM.InitManager) and g_thread_supported then if GetThreadManager(TM) and Assigned(TM.InitManager) and g_thread_supported then

View File

@ -9695,8 +9695,8 @@ var
p: TPoint; p: TPoint;
begin begin
// return cached value to prevent heavy gdk_window_at_pointer call // return cached value to prevent heavy gdk_window_at_pointer call
if (APoint = FLastWFPMousePos) and GTK_IS_WIDGET(Pointer(FLastWFPResult)) then //if (APoint = FLastWFPMousePos) and GTK_IS_WIDGET(Pointer(FLastWFPResult)) then
Exit(FLastWFPResult); // Exit(FLastWFPResult);
//DebugLn('WindowFromPoint: ', dbgs(APoint)); //DebugLn('WindowFromPoint: ', dbgs(APoint));
//DumpStack; //DumpStack;
Result := 0; Result := 0;
@ -9712,8 +9712,8 @@ begin
Widget := gtk_get_event_widget(@ev); Widget := gtk_get_event_widget(@ev);
Result := PtrUInt(Widget); Result := PtrUInt(Widget);
end; end;
FLastWFPMousePos := APoint; //FLastWFPMousePos := APoint;
FLastWFPResult := Result; //FLastWFPResult := Result;
end; end;
//##apiwiz##eps## // Do not remove //##apiwiz##eps## // Do not remove