Skip to content

Commit 7bd295f

Browse files
author
BoboTiG
committed
Add little text why we do not set up XGetPixel()
1 parent 590e947 commit 7bd295f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mss.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@ def __init__(self):
337337
self.root = self.xlib.XDefaultRootWindow(self.display, self.screen)
338338

339339
def _set_argtypes(self):
340-
''' Functions arguments. '''
340+
''' Functions arguments.
341+
342+
Curiously, if we set up self.xlib.XGetPixel.argtypes,
343+
the entire process takes twice more time.
344+
So, no need to waste this precious time :)
345+
'''
341346

342347
self.xlib.XOpenDisplay.argtypes = [c_char_p]
343348
self.xlib.XDefaultScreen.argtypes = [POINTER(Display)]
@@ -363,7 +368,12 @@ def _set_argtypes(self):
363368
self.xrandr.XRRFreeCrtcInfo.argtypes = [POINTER(XRRCrtcInfo)]
364369

365370
def _set_restypes(self):
366-
''' Functions return type. '''
371+
''' Functions return type.
372+
373+
Curiously, if we set up self.xlib.XGetPixel.restype,
374+
the entire process takes twice more time.
375+
So, no need to waste this precious time :)
376+
'''
367377

368378
self.xlib.XOpenDisplay.restype = POINTER(Display)
369379
self.xlib.XDefaultScreen.restype = c_int

0 commit comments

Comments
 (0)