@@ -210,7 +210,7 @@ def _error_handler(display: Display, event: Event) -> int:
210210 return 0
211211
212212
213- def _validate (retval : int , func : Any , args : Tuple [Any , Any ]) -> Tuple [Any , Any ]:
213+ def _validate (retval : int , func : Any , args : Tuple [Any , Any ], / ) -> Tuple [Any , Any ]:
214214 """Validate the returned value of a Xlib or XRANDR function."""
215215
216216 thread = current_thread ()
@@ -237,52 +237,17 @@ def _validate(retval: int, func: Any, args: Tuple[Any, Any]) -> Tuple[Any, Any]:
237237 "XFixesGetCursorImage" : ("xfixes" , [POINTER (Display )], POINTER (XFixesCursorImage )),
238238 "XGetImage" : (
239239 "xlib" ,
240- [
241- POINTER (Display ),
242- POINTER (Display ),
243- c_int ,
244- c_int ,
245- c_uint ,
246- c_uint ,
247- c_ulong ,
248- c_int ,
249- ],
240+ [POINTER (Display ), POINTER (Display ), c_int , c_int , c_uint , c_uint , c_ulong , c_int ],
250241 POINTER (XImage ),
251242 ),
252- "XGetWindowAttributes" : (
253- "xlib" ,
254- [POINTER (Display ), POINTER (XWindowAttributes ), POINTER (XWindowAttributes )],
255- c_int ,
256- ),
243+ "XGetWindowAttributes" : ("xlib" , [POINTER (Display ), POINTER (XWindowAttributes ), POINTER (XWindowAttributes )], c_int ),
257244 "XOpenDisplay" : ("xlib" , [c_char_p ], POINTER (Display )),
258- "XQueryExtension" : (
259- "xlib" ,
260- [
261- POINTER (Display ),
262- c_char_p ,
263- POINTER (c_int ),
264- POINTER (c_int ),
265- POINTER (c_int ),
266- ],
267- c_uint ,
268- ),
245+ "XQueryExtension" : ("xlib" , [POINTER (Display ), c_char_p , POINTER (c_int ), POINTER (c_int ), POINTER (c_int )], c_uint ),
269246 "XRRFreeCrtcInfo" : ("xrandr" , [POINTER (XRRCrtcInfo )], c_void_p ),
270247 "XRRFreeScreenResources" : ("xrandr" , [POINTER (XRRScreenResources )], c_void_p ),
271- "XRRGetCrtcInfo" : (
272- "xrandr" ,
273- [POINTER (Display ), POINTER (XRRScreenResources ), c_long ],
274- POINTER (XRRCrtcInfo ),
275- ),
276- "XRRGetScreenResources" : (
277- "xrandr" ,
278- [POINTER (Display ), POINTER (Display )],
279- POINTER (XRRScreenResources ),
280- ),
281- "XRRGetScreenResourcesCurrent" : (
282- "xrandr" ,
283- [POINTER (Display ), POINTER (Display )],
284- POINTER (XRRScreenResources ),
285- ),
248+ "XRRGetCrtcInfo" : ("xrandr" , [POINTER (Display ), POINTER (XRRScreenResources ), c_long ], POINTER (XRRCrtcInfo )),
249+ "XRRGetScreenResources" : ("xrandr" , [POINTER (Display ), POINTER (Display )], POINTER (XRRScreenResources )),
250+ "XRRGetScreenResourcesCurrent" : ("xrandr" , [POINTER (Display ), POINTER (Display )], POINTER (XRRScreenResources )),
286251 "XSetErrorHandler" : ("xlib" , [c_void_p ], c_int ),
287252}
288253
@@ -295,7 +260,7 @@ class MSS(MSSBase):
295260
296261 __slots__ = {"xfixes" , "xlib" , "xrandr" , "_handles" }
297262
298- def __init__ (self , ** kwargs : Any ) -> None :
263+ def __init__ (self , / , ** kwargs : Any ) -> None :
299264 """GNU/Linux initialisations."""
300265
301266 super ().__init__ (** kwargs )
@@ -355,7 +320,7 @@ def close(self) -> None:
355320
356321 _ERROR .clear ()
357322
358- def _is_extension_enabled (self , name : str ) -> bool :
323+ def _is_extension_enabled (self , name : str , / ) -> bool :
359324 """Return True if the given *extension* is enabled on the server."""
360325 with lock :
361326 major_opcode_return = c_int ()
@@ -385,13 +350,7 @@ def _set_cfunctions(self) -> None:
385350 }
386351 for func , (attr , argtypes , restype ) in CFUNCTIONS .items ():
387352 with suppress (AttributeError ):
388- cfactory (
389- attr = attrs [attr ],
390- errcheck = _validate ,
391- func = func ,
392- argtypes = argtypes ,
393- restype = restype ,
394- )
353+ cfactory (attrs [attr ], func , argtypes , restype , errcheck = _validate )
395354
396355 def _monitors_impl (self ) -> None :
397356 """Get positions of monitors. It will populate self._monitors."""
@@ -435,7 +394,7 @@ def _monitors_impl(self) -> None:
435394 xrandr .XRRFreeCrtcInfo (crtc )
436395 xrandr .XRRFreeScreenResources (mon )
437396
438- def _grab_impl (self , monitor : Monitor ) -> ScreenShot :
397+ def _grab_impl (self , monitor : Monitor , / ) -> ScreenShot :
439398 """Retrieve all pixels from a monitor. Pixels have to be RGB."""
440399
441400 ximage = self .xlib .XGetImage (
0 commit comments