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;
FDragHotStop: TPoint;
// cache for WindowFromPoint
FLastWFPMousePos: TPoint;
FLastWFPResult: HWND;
function CreateThemeServices: TThemeServices; override;
function GetDeviceContextClass: TGtkDeviceContextClass; virtual; abstract;
public

View File

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

View File

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