Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar/sugar-Flickering-and-unknown-icons-in-the-window-bar-870.patch
blob: 1a848f850fa1a2c1e224ef757176feddbeef36fd (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
From patchwork Thu Jan 20 20:15:20 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [sugar] Flickering and unknown icons in the window bar #870
Date: Fri, 21 Jan 2011 01:15:20 -0000
From: Aleksey Lim <alsroot@member.fsf.org>
X-Patchwork-Id: 599
Message-Id: <1295554520-1977-1-git-send-email-alsroot@member.fsf.org>
To: dextrose@lists.sugarlabs.org

---
 src/jarabe/desktop/activitieslist.py |    3 ++-
 src/jarabe/desktop/favoritesview.py  |    1 +
 src/jarabe/desktop/meshbox.py        |    1 +
 src/jarabe/frame/activitiestray.py   |    1 +
 src/jarabe/journal/misc.py           |    4 ++--
 src/jarabe/model/shell.py            |    9 ++++-----
 src/jarabe/view/launcher.py          |    9 ++++++---
 src/jarabe/view/palettes.py          |    1 +
 8 files changed, 18 insertions(+), 11 deletions(-)


diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
index c3a0775..cf5c131 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -149,7 +149,8 @@ class ActivitiesTreeView(gtk.TreeView):
         client = gconf.client_get_default()
         xo_color = XoColor(client.get_string('/desktop/sugar/user/color'))
 
-        launcher.add_launcher(activity_id, bundle.get_icon(), xo_color)
+        launcher.add_launcher(activity_id,
+                bundle.get_bundle_id(), bundle.get_icon(), xo_color)
         activityfactory.create(bundle, ActivityHandle(activity_id))
 
     def set_filter(self, query):
diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
index c59335a..2219be3 100644
--- a/src/jarabe/desktop/favoritesview.py
+++ b/src/jarabe/desktop/favoritesview.py
@@ -492,6 +492,7 @@ class ActivityIcon(CanvasIcon):
 
             activity_id = activityfactory.create_activity_id()
             launcher.add_launcher(activity_id,
+                                  self._activity_info.get_bundle_id(),
                                   self._activity_info.get_icon(),
                                   xo_color)
 
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index fb4be4e..621d4b2 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -829,6 +829,7 @@ class ActivityView(hippo.CanvasBox):
         bundle = bundleregistry.get_registry().get_bundle(bundle_id)
 
         launcher.add_launcher(self._model.get_id(),
+                              bundle.get_bundle_id(),
                               bundle.get_icon(),
                               self._model.get_color())
 
diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py
index 370572c..b20ff8e 100644
--- a/src/jarabe/frame/activitiestray.py
+++ b/src/jarabe/frame/activitiestray.py
@@ -183,6 +183,7 @@ class ActivityInviteButton(BaseInviteButton):
         bundle = registry.get_bundle(self._bundle_id)
 
         launcher.add_launcher(self._activity_model.get_id(),
+                              bundle.get_bundle_id(),
                               bundle.get_icon(),
                               self._activity_model.get_color())
 
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
index 4a2211f..0ad70e3 100644
--- a/src/jarabe/journal/misc.py
+++ b/src/jarabe/journal/misc.py
@@ -231,8 +231,8 @@ def resume(metadata, bundle_id=None):
             object_id = model.copy(metadata, '/')
 
         if activity_id:
-            launcher.add_launcher(activity_id, bundle.get_icon(),
-                    get_icon_color(metadata))
+            launcher.add_launcher(activity_id, bundle.get_bundle_id(),
+                    bundle.get_icon(), get_icon_color(metadata))
             handle = ActivityHandle(object_id=object_id,
                                     activity_id=activity_id)
             activityfactory.create(bundle, handle)
diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
index b9cb0c2..f99af2d 100644
--- a/src/jarabe/model/shell.py
+++ b/src/jarabe/model/shell.py
@@ -601,11 +601,10 @@ class ShellModel(gobject.GObject):
                              " was not found in the bundle registry."
                              % service_name)
         home_activity = Activity(activity_info, activity_id)
-        self._add_activity(home_activity)
-
-        self._set_active_activity(home_activity)
-
-        self.emit('launch-started', home_activity)
+        if home_activity is None:
+            self._add_activity(home_activity)
+            self._set_active_activity(home_activity)
+            self.emit('launch-started', home_activity)
 
         # FIXME: better learn about finishing processes by receiving a signal.
         # Now just check whether an activity has a window after ~90sec
diff --git a/src/jarabe/view/launcher.py b/src/jarabe/view/launcher.py
index 89251e5..1e73549 100644
--- a/src/jarabe/view/launcher.py
+++ b/src/jarabe/view/launcher.py
@@ -32,7 +32,7 @@ from jarabe.view.pulsingicon import CanvasPulsingIcon
 
 class LaunchWindow(gtk.Window):
 
-    def __init__(self, activity_id, icon_path, icon_color):
+    def __init__(self, activity_id, bundle_id, icon_path, icon_color):
         gobject.GObject.__init__(self)
 
         self.props.type_hint = gtk.gdk.WINDOW_TYPE_HINT_NORMAL
@@ -51,6 +51,7 @@ class LaunchWindow(gtk.Window):
         canvas.pack_start(header, expand=False)
 
         self._activity_id = activity_id
+        self._bundle_id = bundle_id
         self._box = LaunchBox(activity_id, icon_path, icon_color)
         box = hippo.Canvas()
         box.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
@@ -88,6 +89,7 @@ class LaunchWindow(gtk.Window):
         self.resize(gtk.gdk.screen_width(), gtk.gdk.screen_height())
 
     def __realize_cb(self, widget):
+        wm.set_bundle_id(widget.window, str(self._bundle_id))
         wm.set_activity_id(widget.window, str(self._activity_id))
         widget.window.property_change('_SUGAR_WINDOW_TYPE', 'STRING', 8,
                                       gtk.gdk.PROP_MODE_REPLACE, 'launcher')
@@ -163,13 +165,13 @@ def setup():
     model.connect('launch-completed', __launch_completed_cb)
 
 
-def add_launcher(activity_id, icon_path, icon_color):
+def add_launcher(activity_id, bundle_id, icon_path, icon_color):
     model = shell.get_model()
 
     if model.get_launcher(activity_id) is not None:
         return
 
-    launch_window = LaunchWindow(activity_id, icon_path, icon_color)
+    launch_window = LaunchWindow(activity_id, bundle_id, icon_path, icon_color)
     launch_window.show()
 
     model.register_launcher(activity_id, launch_window)
@@ -177,6 +179,7 @@ def add_launcher(activity_id, icon_path, icon_color):
 
 def __launch_started_cb(home_model, home_activity):
     add_launcher(home_activity.get_activity_id(),
+            home_activity.get_bundle_id(),
             home_activity.get_icon_path(), home_activity.get_icon_color())
 
 
diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py
index 5994c3d..f93399e 100644
--- a/src/jarabe/view/palettes.py
+++ b/src/jarabe/view/palettes.py
@@ -154,6 +154,7 @@ class ActivityPalette(Palette):
 
         activity_id = activityfactory.create_activity_id()
         launcher.add_launcher(activity_id,
+                              self._activity_info.get_bundle_id(),
                               self._activity_info.get_icon(),
                               xo_color)