From fc33b4e39215389a79a962892735c455f1e32a19 Mon Sep 17 00:00:00 2001
From: James Cameron <quozl@laptop.org>
Date: Wed, 20 Jan 2010 13:38:24 +1100
Subject: [PATCH] screen rotate, avoid xmodmap if xrandr fails
xrandr may fail on some hardware because of missing X server support.
By the time we observe the xrandr failure, the keys have already been
remapped.
This patch changes the order of the commands so that xmodmap is skipped
if xrandr fails.
---
src/jarabe/view/keyhandler.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/jarabe/view/keyhandler.py b/src/jarabe/view/keyhandler.py
index 1da1f6a..0905db4 100644
a
|
b
|
class KeyHandler(object): |
249 | 249 | # If either the xmodmap or xrandr command fails, check_call will fail |
250 | 250 | # with CalledProcessError, which we raise. |
251 | 251 | try: |
252 | | subprocess.check_call(argv) |
253 | 252 | subprocess.check_call(['xrandr', '-o', |
254 | 253 | states[self._screen_rotation]]) |
| 254 | subprocess.check_call(argv) |
255 | 255 | except OSError, e: |
256 | 256 | if e.errno != errno.EINTR: |
257 | 257 | raise |