diff --git a/Source/editor/simba.editor_findreplace.pas b/Source/editor/simba.editor_findreplace.pas index 22bc32d17..930df2d66 100644 --- a/Source/editor/simba.editor_findreplace.pas +++ b/Source/editor/simba.editor_findreplace.pas @@ -220,7 +220,7 @@ function TCustomReplaceDialog.Execute: Boolean; FFindForm.OnClose := @DoCloseForm; FFindForm.OnShow := @DoShowForm; FFindForm.Caption := Title; - FFindForm.ShowOnTop(); + FFindForm.ShowModal(); Height := FFindForm.Height; Width := FFindForm.Width; diff --git a/Source/simba.mouselogger.pas b/Source/simba.mouselogger.pas index ba21664b1..25af2612d 100644 --- a/Source/simba.mouselogger.pas +++ b/Source/simba.mouselogger.pas @@ -105,10 +105,16 @@ procedure TSimbaMouseLogger.Execute; if not Window.IsValid() then Window := GetDesktopWindow(); - with Window.GetRelativeCursorPos() do + if Window.IsVisible() then + with Window.GetRelativeCursorPos() do + begin + Point.X := Int16(X); // cast to prevent overflows when debugging + Point.Y := Int16(Y); + end + else begin - Point.X := X; - Point.Y := Y; + Point.X := -1; + Point.Y := -1; end; if (Point.X <> PrevPoint.X) or (Point.Y <> PrevPoint.Y) then diff --git a/Source/simba.nativeinterface_windows.pas b/Source/simba.nativeinterface_windows.pas index 4a6af7e3c..2e0526b26 100644 --- a/Source/simba.nativeinterface_windows.pas +++ b/Source/simba.nativeinterface_windows.pas @@ -792,7 +792,7 @@ function TSimbaNativeInterface_Windows.IsWindowValid(Window: TWindowHandle): Boo function TSimbaNativeInterface_Windows.IsWindowVisible(Window: TWindowHandle): Boolean; begin - Result := Windows.IsWindowVisible(Window) and (not IsIconic(Window)) + Result := Windows.IsWindowVisible(Window) and (not IsIconic(GetRootWindow(Window))); end; function TSimbaNativeInterface_Windows.GetWindowPID(Window: TWindowHandle): Integer;