Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Nov 18, 2023
1 parent 25b5ec6 commit 76e870b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/editor/simba.editor_findreplace.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 9 additions & 3 deletions Source/simba.mouselogger.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/simba.nativeinterface_windows.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 76e870b

Please sign in to comment.