Blame disper_0.3.1-fix-misbehavior-bug-1531704.diff

7c60c3
diff -Naur disper/src/xrandr/__init__.py disper-new/src/xrandr/__init__.py
7c60c3
--- disper/src/xrandr/__init__.py	2011-09-09 16:20:45.000000000 +0200
7c60c3
+++ disper-new/src/xrandr/__init__.py	2016-07-28 15:33:34.391703460 +0200
7c60c3
@@ -83,10 +83,20 @@
7c60c3
 
7c60c3
 from core import Screen, xlib, rr
7c60c3
 
7c60c3
+xopendisplay = None
7c60c3
+class Display(Structure): pass
7c60c3
+
7c60c3
+def get_display(name):
7c60c3
+    global xopendisplay
7c60c3
+    if xopendisplay is None:
7c60c3
+        xopendisplay = xlib.XOpenDisplay
7c60c3
+        xopendisplay.restype = POINTER(Display)
7c60c3
+    return xopendisplay(name)
7c60c3
+
7c60c3
 def get_current_display():
7c60c3
     """Returns the currently used display"""
7c60c3
     display_url = os.getenv("DISPLAY")
7c60c3
-    dpy = xlib.XOpenDisplay(display_url)
7c60c3
+    dpy = get_display(display_url)
7c60c3
     return dpy
7c60c3
 
7c60c3
 def get_current_screen():
7c60c3
@@ -98,7 +108,7 @@
7c60c3
 
7c60c3
 def get_screen_of_display(display, count):
7c60c3
     """Returns the screen of the given display"""
7c60c3
-    dpy = xlib.XOpenDisplay(display)
7c60c3
+    dpy = get_display(display)
7c60c3
     return Screen(dpy, count)
7c60c3
 
7c60c3
 def get_version():