The cause of this seems to be that Microsoft made the window borders partially invisible in Windows 10:
So the left edge of the border is at x=0 as expected, you just can’t see it. I guess that also explains why the mouse cursor changes to the resize symbol before it visibly touches the window.
The StackOverflow post suggests offsetting by 7 pixels. If you don’t want to hardcode it, you can supposedly (but I haven’t tested this) get this value from the GetSystemMetrics function, which you can call via ctypes. Something like this (untested):
Thank you very much Henrik and Matthew!
What an awkward thing to do!
I think the easiest thing to do is to apply an offset of -8 manually, which is exactly what I didn’t want to do, as I thought I was making a mistake or had a problem in my configuration.
Thanks again!