summaryrefslogtreecommitdiffstats
path: root/src/monitor.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-04 15:10:58 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-04 15:10:58 +0200
commitd5b0ad4ed6aec920c5131f85a6d85cd76f44291b (patch)
treea2f2daa0ffc591ac388b1c9c2bf75643c05a6a00 /src/monitor.py
parenttypo (diff)
downloadblueshift-d5b0ad4ed6aec920c5131f85a6d85cd76f44291b.tar.gz
blueshift-d5b0ad4ed6aec920c5131f85a6d85cd76f44291b.tar.bz2
blueshift-d5b0ad4ed6aec920c5131f85a6d85cd76f44291b.tar.xz
multi-display support can apply once, then it segfaults
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/monitor.py')
-rw-r--r--src/monitor.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/monitor.py b/src/monitor.py
index 84be9c9..e58836b 100644
--- a/src/monitor.py
+++ b/src/monitor.py
@@ -93,7 +93,7 @@ def randr_get(crtc = 0, screen = 0, display = None):
if randr_opened is not None:
randr_close()
# Open RandR connection
- if randr_open(screen, display) == 0:
+ if randr_open(screen, display if display is None else display.encode('utf-8')) == 0:
randr_opened = (screen, display)
else:
raise Exception('Cannot open RandR connection')
@@ -118,7 +118,7 @@ def vidmode_get(crtc = 0, screen = 0, display = None):
if vidmode_opened is not None:
vidmode_close()
# Open vidmode connection
- if vidmode_open(screen, display):
+ if vidmode_open(screen, display if display is None else display.encode('utf-8')):
vidmode_opened = (screen, display)
else:
raise Exception('Cannot open vidmode connection')
@@ -162,7 +162,7 @@ def randr(*crtcs, screen = 0, display = None):
if randr_opened is not None:
randr_close()
# Open RandR connection
- if randr_open(screen, display) == 0:
+ if randr_open(screen, display if display is None else display.encode('utf-8')) == 0:
randr_opened = (screen, display)
else:
raise Exception('Cannot open RandR connection')
@@ -195,7 +195,7 @@ def vidmode(*crtcs, screen = 0, display = None):
if vidmode_opened is not None:
vidmode_close()
# Open vidmode connection
- if vidmode_open(screen, display):
+ if vidmode_open(screen, display if display is None else display.encode('utf-8')):
vidmode_opened = (screen, display)
else:
raise Exception('Cannot open vidmode connection')