Skip to content

Conversation

Sohimaster
Copy link

@Sohimaster Sohimaster commented Dec 22, 2024

This PR resolves an issue in the GetDisplayBounds function on Linux systems where:

    1. Bounds were incorrectly calculated due to improper handling of absolute coordinates.
    2. Displays with non-standard arrangements produced incorrect bounds.

Changes:

    1. Updated GetDisplayBounds to use absolute coordinates based on xinerama data.

Testing:

    1. Verified the fix using multi-monitor setups on Linux.
    2. Confirmed screenshots correctly match individual monitor bounds.

@Sohimaster
Copy link
Author

@kbinani Hi! Let's merge the fix if you don't have any questions

@kbinani
Copy link
Owner

kbinani commented Dec 23, 2024

@Sohimaster Thanks for the PR. According to the coordinate section in the README, this library treats the top-left of the primary screen as the origin. Your changes seem to break that design. Please review the README’s coordinate section to ensure consistency with our approach.

@Sohimaster
Copy link
Author

@kbinani not really sure what it means but the library wasn't working for me before as it doesn't expect the primary screen to have index different than 0 (as in my setup in the picture)

so when I was taking a screenshot of my primary screen, it would capture the other one instead with an incorrect resolution. As for the other one, it did not capture anything at all. So I did some debugging and found the cause which I fixed in this PR
image

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