nut.js icon indicating copy to clipboard operation
nut.js copied to clipboard

Make `Screen.find` support multiple monitors

Open comcaptain opened this issue 3 years ago • 13 comments

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

comcaptain avatar Aug 30 '20 03:08 comcaptain

is there any news for this?

fadhilx avatar Nov 26 '20 02:11 fadhilx

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:

svettwer avatar Nov 26 '20 06:11 svettwer

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

github-actions[bot] avatar Apr 28 '22 02:04 github-actions[bot]

Still open

s1hofmann avatar Apr 29 '22 18:04 s1hofmann

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

github-actions[bot] avatar May 30 '22 02:05 github-actions[bot]

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

github-actions[bot] avatar Jul 09 '22 02:07 github-actions[bot]

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

github-actions[bot] avatar Jul 23 '22 02:07 github-actions[bot]

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

raphaelmenges avatar Nov 21 '22 08:11 raphaelmenges

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

Correct

s1hofmann avatar Nov 21 '22 08:11 s1hofmann

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

raphaelmenges avatar Nov 21 '22 21:11 raphaelmenges

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 🙁

s1hofmann avatar Nov 22 '22 17:11 s1hofmann

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 :)

raphaelmenges avatar Nov 23 '22 08:11 raphaelmenges

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.

draeder avatar Dec 28 '22 11:12 draeder