Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take screenshot from Primary window when using multiple monitors #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmikhan
Copy link

@mmikhan mmikhan commented Mar 29, 2017

When using multiple monitors, the script couldn't detect any monitor as when using multiple monitors, it never returns the Entire screen as the source name. So, I've fixed the issue.

Now when there are multiple monitors, the script will take screenshot from the primary monitor.

@mixalbl4-127
Copy link
Owner

I have tested on multiple monitors, in my linux "Entire screen" returns picture for all monitors together.
What system do you use? Do you haven't "Entire screen" in sources when you use multi-monitor?
This code isn't correct if (sources[i].name === "Entire screen" || sources[i].name === "Screen 1"), because if in sources you have "Entire screen" and "Screen 1" too, callback will be called twice.

If your system isn't combine pictures from all monitors to one picture, we will need get all pictures and combine it to one manualy, after that we can call callback once with 1 pictures.
Or we can to get all pictures from all monitors and return array of pictures.
But, in my system it happens automatically and I can't do it, because I can't test it.

@mmikhan
Copy link
Author

mmikhan commented Apr 4, 2017

I'm using macOS Sierra. In this OS, it returns Screen 1, Screen 2 when you've multiple monitors. Not sure about the Linux. What distro are you using? I am also unable to test it on Linux as I don't have a Linux setup on my end.

If the Linux returns Entire Screen and Screen 1 too, then the code is wrong. But, I'm not sure what Linux returns. Can you please let me know what Linux returns and in which distro?

@mixalbl4-127
Copy link
Owner

mixalbl4-127 commented Apr 4, 2017

I'm using Linux mint 18
Linux mixa-corporation 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
In my case, when I use multi-monitor in I've only Entire Screen with two monitor pictures combined to one picture like in monitor setup http://s3.micp.ru/ahmpc.png

@mmikhan
Copy link
Author

mmikhan commented Apr 4, 2017

Aah, In this case, we'll need to check for OS first, then we'll need to take the screenshot. In this case, since the Linux Mint 18 distro only returns the Entire Screen, I'll write check for macOS Sierra.

@mixalbl4-127
Copy link
Owner

mixalbl4-127 commented Apr 4, 2017

I think we can detect all monitors (with Entire Screen too) and if we have only one monitor, we'll return only one screenshot like now, but if we have 1+ monitors we`ll make 1+ screenshots and return array with screenshots
This is better way then detect OS

@mmikhan
Copy link
Author

mmikhan commented Apr 4, 2017

But what would be the use case of multiple screenshots when we've multiple monitors?

@mixalbl4-127
Copy link
Owner

I`ll think about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants