Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar/Sugar-Fix-globalkey-touchpad-corner-case.patch
blob: 6d86f132dc416e201e98c70885ded3a31a18ecd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From patchwork Wed Feb 16 21:15:12 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [Sugar] Fix globalkey touchpad corner case
Date: Thu, 17 Feb 2011 02:15:12 -0000
From: Martin Abente <martin.abente.lahaye@gmail.com>
X-Patchwork-Id: 674
Message-Id: <1297890912-18522-1-git-send-email-martin.abente.lahaye@gmail.com>
To: dextrose@lists.sugarlabs.org,
	anish@sugarlabs.org

This patch is not intended for upstream. Is just a minimal
hack to fix a corner case, where the palette must be created
before the tray icon or global can toggle the touchpad mode.

A serious fix could consist on moving the mode-switching
code from extensions/deviceicon/touchpad.py to a touchpad
module at src/jarabe/model.

This model should provide a public mode_toggle method and 
also emit proper signals when it occurs. This way different
pieces of sugar code will be able to interact with the touchpad
properly without repeating code all over.

---
extensions/deviceicon/touchpad.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/extensions/deviceicon/touchpad.py b/extensions/deviceicon/touchpad.py
index 357bdd6..366bf74 100644
--- a/extensions/deviceicon/touchpad.py
+++ b/extensions/deviceicon/touchpad.py
@@ -52,13 +52,14 @@ class DeviceView(TrayIcon):
         color = XoColor(client.get_string('/desktop/sugar/user/color'))
         TrayIcon.__init__(self, icon_name=icon_name, xo_color=color)
 
+        self._palette = ResourcePalette(_('My touchpad'), self.icon)
+        self._palette.set_group_id('frame')
+
         self.set_palette_invoker(FrameWidgetInvoker(self))
         self.connect('button-release-event', self.__button_release_event_cb)
 
     def create_palette(self):
         """ On create, set the current mode. """
-        self._palette = ResourcePalette(_('My touchpad'), self.icon)
-        self._palette.set_group_id('frame')
         return self._palette
 
     def __button_release_event_cb(self, widget, event):