Skip to content

Find Coordinates are wrong for MacOS when using a resolution other than default. #51

@hhslepicka

Description

@hhslepicka

Describe the bug
On MacOS, if using a resolution different than default the find command works properly but the coordinates are wrong as they are calculated based on the default screen resolution and not the one currently in use.

Expected behavior
Find works and the coordinates are adjusted to the user's selected monitor resolution.

Steps to Reproduce

  • Configure the resolution to be different than the default for the display
  • Perform a find
  • Move the mouse to the element center
  • Observe that it won't be in the proper location

Possible Solution

My Platform

  • MacOS
  • Display with 4K resolution
  • System set up to half of the display capable resolution

Additional context

$ system_profiler SPDisplaysDataType
Graphics/Displays:

    Apple M2 Pro:

      Chipset Model: Apple M2 Pro
      Type: GPU
      Bus: Built-In
      Total Number of Cores: 19
      Vendor: Apple (0x106b)
      Metal Support: Metal 3
      Displays:
        DELL P2715Q:
          Resolution: 3840 x 2160 (2160p/4K UHD 1 - Ultra High Definition)
          UI Looks like: 1920 x 1080 @ 30.00Hz
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Rotation: Supported
(temp) $ python -c "from botcity.core import DesktopBot; bot = DesktopBot(); print(bot.get_screenshot().size)"
(3840, 2160)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions