Ticket #1667: 0001-screen-rotate-avoid-xmodmap-if-xrandr-fails.patch

File 0001-screen-rotate-avoid-xmodmap-if-xrandr-fails.patch, 1.2 KB (added by quozl, 14 years ago)
  • src/jarabe/view/keyhandler.py

    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): 
    249249        # If either the xmodmap or xrandr command fails, check_call will fail
    250250        # with CalledProcessError, which we raise.
    251251        try:
    252             subprocess.check_call(argv)
    253252            subprocess.check_call(['xrandr', '-o',
    254253                                   states[self._screen_rotation]])
     254            subprocess.check_call(argv)
    255255        except OSError, e:
    256256            if e.errno != errno.EINTR:
    257257                raise