Ticket #1476: sugar-1476.patch

File sugar-1476.patch, 3.4 KB (added by alsroot, 13 years ago)
  • bin/sugar.in

    From 98995c8175d5b1f36719e40ae00529cd03b3f59a Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Fri, 9 Oct 2009 16:55:06 +0000
    Subject: Alt+Space not working to show/hide the tray #1476
    
    ---
     bin/sugar.in                  |   10 ----------
     src/jarabe/model/shell.py     |   19 +++++++++++++++++++
     src/jarabe/view/keyhandler.py |   11 -----------
     3 files changed, 19 insertions(+), 21 deletions(-)
    
    diff --git a/bin/sugar.in b/bin/sugar.in
    index 094917f..fea79a9 100644
    a b EOF 
    1414    exit 0
    1515}
    1616
    17 init_cursor() {
    18     # have to reset cursor(metacity sets it on startup)
    19     # ugly but works
    20     for i in 1 2 3; do
    21         sleep 1
    22         xsetroot -cursor_name left_ptr
    23     done
    24 }
    25 
    2617while [ $# -ne 0 ] ; do
    2718    case "$1" in
    2819        -d | --display)
    fi 
    6152
    6253echo Xcursor.theme: sugar | xrdb -merge
    6354metacity --no-force-fullscreen -d $DISPLAY &
    64 init_cursor &
    6555
    6656exec sugar-session
  • src/jarabe/model/shell.py

    diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
    index ef2268d..8693e26 100644
    a b  
    1717
    1818import logging
    1919import time
     20import subprocess
    2021
    2122import gconf
    2223import wnck
    class ShellModel(gobject.GObject): 
    322323        self._screen.connect('window-closed', self._window_closed_cb)
    323324        self._screen.connect('active-window-changed',
    324325                             self._active_window_changed_cb)
     326        self._screen.connect('window-manager-changed',
     327                             self.__window_manager_changed_cb)
    325328
    326329        self.zoom_level_changed = dispatch.Signal()
    327330
    class ShellModel(gobject.GObject): 
    591594            self.notify_launch_failed(activity_id)
    592595        return False
    593596
     597    def __window_manager_changed_cb(self, screen):
     598        wm_name = screen.get_window_manager_name()
     599        if wm_name is not None:
     600            logging.debug('Setup %s wm', wm_name)
     601            self._setup_wm()
     602
     603    def _setup_wm(self):
     604        # have to reset cursor(metacity sets it on startup)
     605        if subprocess.call('xsetroot -cursor_name left_ptr', shell=True):
     606            logging.warning('Can not reset cursor')
     607
     608        if subprocess.call('metacity-message disable-keybindings',
     609                shell=True):
     610            logging.warning('Can not disable metacity keybindings')
     611
     612
    594613_model = None
    595614
    596615def get_model():
  • src/jarabe/view/keyhandler.py

    diff --git a/src/jarabe/view/keyhandler.py b/src/jarabe/view/keyhandler.py
    index 478a4c0..acbbb04 100644
    a b class KeyHandler(object): 
    7474        self._keystate_pressed = 0
    7575        self._speech_proxy = None
    7676
    77         self._ungrab_metacity_keys()
    78 
    7977        self._key_grabber = KeyGrabber()
    8078        self._key_grabber.connect('key-pressed',
    8179                                  self._key_pressed_cb)
    class KeyHandler(object): 
    10199
    102100        self._key_grabber.grab_keys(_actions_table.keys())
    103101
    104     def _ungrab_metacity_keys(self):
    105         """So we can grab those instead.
    106         """
    107         client = gconf.client_get_default()
    108         for key in ['run_command_screenshot', 'switch_windows',
    109                     'cycle_windows']:
    110             key = '/apps/metacity/global_keybindings/' + key
    111             client.set_string(key, 'disabled')
    112 
    113102    def _change_volume(self, step=None, value=None):
    114103        if step is not None:
    115104            volume = sound.get_volume() + step