summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/blueshift_randr.pyx6
-rw-r--r--src/blueshift_vidmode.pyx6
-rw-r--r--src/monitor.py8
3 files changed, 10 insertions, 10 deletions
diff --git a/src/blueshift_randr.pyx b/src/blueshift_randr.pyx
index 756ea73..e845f65 100644
--- a/src/blueshift_randr.pyx
+++ b/src/blueshift_randr.pyx
@@ -44,9 +44,9 @@ def randr_open(int use_screen, display):
'''
Start stage of colour curve control
- @param use_screen The screen to use
- @param display:str? The display to use, `None` for the current
- @return :int Zero on success
+ @param use_screen The screen to use
+ @param display:bytes? The display to use, `None` for the current
+ @return :int Zero on success
'''
cdef char* display_ = NULL
if display is not None:
diff --git a/src/blueshift_vidmode.pyx b/src/blueshift_vidmode.pyx
index e4262d7..7ad7a4c 100644
--- a/src/blueshift_vidmode.pyx
+++ b/src/blueshift_vidmode.pyx
@@ -50,9 +50,9 @@ def vidmode_open(int use_screen, display):
'''
Start stage of colour curve control
- @param use_screen The screen to use
- @param display:str? The display to use, `None` for the current
- @return :bool Whether call was successful
+ @param use_screen The screen to use
+ @param display:bytes? The display to use, `None` for the current
+ @return :bool Whether call was successful
'''
global vidmode_gamma_size
cdef char* display_ = NULL
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')