Roger / escrotum

Linux screen capture using pygtk, inspired by scrot
GNU General Public License v3.0
214 stars 22 forks source link

Fix segfault in get_selected_window() since python 2.7.10 #22

Closed dequis closed 9 years ago

dequis commented 9 years ago

With the new python 2.7.10 release, in 64 bit platforms, ctypes started guessing the return value of XOpenDisplay() as a 32 bit int instead of a 64 bit void *, which truncated the pointer and resulted in segfaults when passing it to the next functions.

Fixed by telling ctypes the return value type (which avoids truncation before we even get it), and turning the display variable into a c_void_p (which avoids truncation when passing it to the following functions)

Fixes #21