asweigart / asweigart/PyGetWindow
Window's bounding box includes "invisible borders"
- Dominant language
- Python
- Stars
- 422
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I was using pyautogui module that is using this, and I found some strange issue. It is not a case of the library here (Windows related), but I'd say that maybe it could be adapted?
My OS is Windows 10, 64 bit, Python 3.7.1.
Generally, when Window is placed (seemingly) at 0,0, and the Windows is found and then when getting the 'box' (_getWindowRect or whatever) 'it will show something such as:
-7, 0, right, bottom
where, the -7 is surprising and caused me some mistakes on "exact" pixel analysis.
I did try this using the library, but also by executing the code in C# - the result is the same. However, this issue was not only observed by me, but also here:
https://stackoverflow.com/questions/34139450/getwindowrect-returns-a-size-including-invisible-borders
I'd not know about all the use-cases, but maybe it would be worth to add an option to get the "box" with taking these values in consideration? As not to mess up with the other libs, maybe set this value as not default, but just as a possibility.
In this answer, the code's already there - I could even adapt the change, but still, the question is whether it would not "cause problems" and has it ever been discussed?
The aforementioned answer: https://stackoverflow.com/a/34143777
Regards,
MG.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.