nut-tree / nut.js

Native UI testing / controlling with node
https://nutjs.dev
2.2k stars 121 forks source link

Make `Screen.find` support multiple monitors #165

Open comcaptain opened 4 years ago

comcaptain commented 4 years ago

Short overview According to doc of Screen.find and my experiment, search can only be done in the main monitor

Use case It would be very convenient if Screen.find can work on multiple monitors

fadhilx commented 3 years ago

is there any news for this?

svettwer commented 3 years ago

Hiho :wave:

Nope, no news. I'm using a dual monitor setup where screen.find works great. Maybe it depends on the window/desktop manager?! Some more information about the setup of @comcaptain would be nice for evaluation. But we're also always happy to receive PRs. :tada:

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

s1hofmann commented 2 years ago

Still open

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

raphaelmenges commented 1 year ago

I believe the same limitation applies for Screen.grabRegion? At least on macOS.

s1hofmann commented 1 year ago

I believe the same limitation applies for Screen.grabRegion? At least on macOS.

Correct

raphaelmenges commented 1 year ago

Looking forward for this feature. I have even taken the effort to port the captureScreen function of RobotJS to node-addon-api for the mean time, since that works for my multi-monitor setup: https://github.com/raphaelmenges/robotjs/commit/da27b5297d6d0d3b61e38e5e33597950d5411490

s1hofmann commented 1 year ago

Capturing all monitors at once is actually doable, the reason why I've limited it to the main screen for now is that I need to spend some time to investigate how to handle screen coordinates consistently across the different window systems to properly work with scale settings, sorting etc.

I prefer a limited but consistent setup over something that could work by accident.

But as long as I don't have enough sponsorships to work on it full time it will take a while to land this, as I'm quite limited with my time 🙁

raphaelmenges commented 1 year ago

Thanks for the reply and effort!

To my understanding, the multi-monitor support of Robotjs indeed does work by accident, but it is fine so far. The different scaling and DPI handling across different systems is really a pain and I am looking forward for a sensible solution :)

draeder commented 1 year ago

Dropping a comment for notifications on updates to this issue.

EDIT: For MacOS these commands reveal the coordinate info I need -

defaults read /Library/Preferences/com.apple.windowserver.plist > output.txt on my MacBook Pro 2020 13" running macOS Monterey (v12.5.1). But, talking with another developer, he doesn't have that domain, but instead has: com.apple.windowserver.displays.plist.