Merge lp:~unity-team/unity/njpatel-2010-07-02-bug-fixes into lp:unity

Proposed by Neil J. Patel
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 369
Proposed branch: lp:~unity-team/unity/njpatel-2010-07-02-bug-fixes
Merge into: lp:unity
Diff against target: 371 lines (+94/-39)
12 files modified
.bzrignore (+4/-0)
Makefile.am (+4/-2)
targets/mutter/plugin.vala (+30/-19)
tests/ui/test-home-button.vala (+6/-0)
unity-private/launcher/application-controller.vala (+4/-1)
unity-private/panel/panel-indicator-object-entry-view.vala (+23/-10)
unity-private/panel/panel-menu-manager.vala (+5/-2)
unity-private/places/places-default-renderer-group.vala (+1/-1)
unity-private/places/places-place-bar.vala (+0/-1)
unity-private/places/places-place-model.vala (+6/-3)
unity-private/testing/test-window.vala (+10/-0)
unity/shell.vala (+1/-0)
To merge this branch: bzr merge lp:~unity-team/unity/njpatel-2010-07-02-bug-fixes
Reviewer Review Type Date Requested Status
Gord Allott (community) Approve
Mirco Müller (community) Needs Fixing
Review via email: mp+29146@code.launchpad.net

Description of the change

Please see the linked bugs for the description of changes. Also, there should be a bugfix-per-commit, to ease review.

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

Selecting the overlay-mode doesn't allow to exit it again. Search doesn't work, selecting indicators doesn't work (no menus show up). One has to exit X11 completely and start gdm to get a responding system again. This is on Lucid.

review: Needs Fixing
Revision history for this message
Gord Allott (gordallott) wrote :

works well for me, approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-06-28 14:28:48 +0000
3+++ .bzrignore 2010-07-03 13:30:43 +0000
4@@ -317,3 +317,7 @@
5 targets/mutter/spaces-manager.c
6 unity/unity-pixbuf-cache.c
7 tests/unit/test-unity-pixbuf-cache.c
8+tests/unit/test-appinfo-manager.c
9+tests/unit/test-io.c
10+unity/unity-appinfo-manager.c
11+unity/unity-io.c
12
13=== modified file 'Makefile.am'
14--- Makefile.am 2010-06-09 14:24:08 +0000
15+++ Makefile.am 2010-07-03 13:30:43 +0000
16@@ -28,5 +28,7 @@
17 EXTRA_DIST = \
18 autogen.sh \
19 COPYING \
20- unity.pc.in \
21- COPYING.LGPL
22+ COPYING.LGPL \
23+ HACKING \
24+ unity.pc.in
25+
26
27=== modified file 'targets/mutter/plugin.vala'
28--- targets/mutter/plugin.vala 2010-06-25 15:33:40 +0000
29+++ targets/mutter/plugin.vala 2010-07-03 13:30:43 +0000
30@@ -196,7 +196,7 @@
31
32 this.wm = new WindowManagement (this);
33 this.maximus = new Maximus ();
34-
35+
36 END_FUNCTION ();
37 }
38
39@@ -239,7 +239,7 @@
40
41 this.launcher = new Launcher.Launcher (this);
42 this.launcher.get_view ().opacity = 0;
43-
44+
45 this.spaces_manager = new SpacesManager (this);
46 this.spaces_manager.set_padding (50, 50, 125, 50);
47
48@@ -584,27 +584,38 @@
49 expose_manager.end_expose ();
50 }
51
52+ public void hide_unity ()
53+ {
54+ if (places_showing == false)
55+ return;
56+
57+ places_showing = false;
58+
59+ var anim = dark_box.animate (Clutter.AnimationMode.EASE_IN_QUAD, 100, "opacity", 0);
60+ anim.completed.connect ((an) => {
61+ (an.get_object () as Clutter.Actor).destroy ();
62+ });
63+
64+ plugin.get_normal_window_group ().animate (Clutter.AnimationMode.EASE_OUT_QUAD, 100, "opacity", 255);
65+
66+ anim = places.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 100,
67+ "opacity", 0);
68+ anim.completed.connect ((an) => {
69+ (an.get_object () as Clutter.Actor).hide ();
70+ });
71+
72+ panel.set_indicator_mode (false);
73+ ensure_input_region ();
74+
75+ while (Gtk.events_pending ())
76+ Gtk.main_iteration ();
77+ }
78+
79 public void show_unity ()
80 {
81 if (this.places_showing)
82 {
83- this.places_showing = false;
84-
85- var anim = dark_box.animate (Clutter.AnimationMode.EASE_IN_QUAD, 100, "opacity", 0);
86- anim.completed.connect ((an) => {
87- (an.get_object () as Clutter.Actor).destroy ();
88- });
89-
90- plugin.get_normal_window_group ().animate (Clutter.AnimationMode.EASE_OUT_QUAD, 100, "opacity", 255);
91-
92- anim = places.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 100,
93- "opacity", 0);
94- anim.completed.connect ((an) => {
95- (an.get_object () as Clutter.Actor).hide ();
96- });
97-
98- this.panel.set_indicator_mode (false);
99- this.ensure_input_region ();
100+ hide_unity ();
101 }
102 else
103 {
104
105=== modified file 'tests/ui/test-home-button.vala'
106--- tests/ui/test-home-button.vala 2010-06-22 17:18:49 +0000
107+++ tests/ui/test-home-button.vala 2010-07-03 13:30:43 +0000
108@@ -85,6 +85,12 @@
109 g_flag = true;
110 }
111
112+ public void
113+ hide_unity ()
114+ {
115+
116+ }
117+
118 public int
119 get_indicators_width ()
120 {
121
122=== modified file 'unity-private/launcher/application-controller.vala'
123--- unity-private/launcher/application-controller.vala 2010-07-01 11:09:37 +0000
124+++ unity-private/launcher/application-controller.vala 2010-07-03 13:30:43 +0000
125@@ -49,12 +49,13 @@
126 context.set_timestamp (Gdk.CURRENT_TIME);
127
128 appinfo.launch (null, context);
129+
130+ global_shell.hide_unity ();
131 }
132 catch (Error e)
133 {
134 warning (e.message);
135 }
136-
137 }
138 }
139
140@@ -383,6 +384,8 @@
141
142 public override void activate ()
143 {
144+ global_shell.hide_unity ();
145+
146 if (app is Bamf.Application)
147 {
148 if (app.is_running ())
149
150=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
151--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-06-23 21:18:02 +0000
152+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-07-03 13:30:43 +0000
153@@ -30,7 +30,6 @@
154 private bool menu_is_open = false;
155
156 private uint32 click_time;
157- private float last_found_entry_x = 0.0f;
158
159 private float last_width = 0;
160 private float last_height = 0;
161@@ -44,6 +43,11 @@
162 reactive:true);
163 }
164
165+ ~IndicatorObjectEntryView ()
166+ {
167+ bg.unparent ();
168+ }
169+
170 construct
171 {
172 /* Figure out if you need a label, text or both, create the ctk
173@@ -86,7 +90,7 @@
174 {
175 image.hide ();
176 }
177-
178+
179 entry.image.notify["visible"].connect (() =>
180 {
181 if (entry.image != null)
182@@ -140,7 +144,7 @@
183 {
184 text.text = entry.label.label;
185 });
186-
187+
188 if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
189 {
190 text.show ();
191@@ -149,7 +153,7 @@
192 {
193 text.hide ();
194 }
195-
196+
197 entry.label.notify["visible"].connect (() =>
198 {
199 if (entry.label != null)
200@@ -163,7 +167,7 @@
201 text.hide ();
202 }
203 }
204- });
205+ });
206 }
207 }
208
209@@ -173,14 +177,19 @@
210 out bool push_in)
211 {
212 y = (int)height;
213- x = (int)last_found_entry_x;
214+
215+ float xx;
216+ get_transformed_position (out xx, null);
217+
218+ x = (int)xx;
219 }
220
221 public void show_menu ()
222 {
223 if (entry.menu is Gtk.Menu)
224 {
225- last_found_entry_x = x + get_parent ().x + get_parent ().get_parent ().x;
226+ global_shell.hide_unity ();
227+
228 MenuManager.get_default ().register_visible_menu (entry.menu);
229 entry.menu.popup (null,
230 null,
231@@ -188,6 +197,7 @@
232 1,
233 Clutter.get_current_event_time ());
234 click_time = Clutter.get_current_event_time ();
235+ menu_is_open = true;
236 menu_shown ();
237 }
238 }
239@@ -216,7 +226,8 @@
240 }
241 else
242 {
243- last_found_entry_x = x + get_parent ().x + get_parent ().get_parent ().x;
244+ global_shell.hide_unity ();
245+
246 MenuManager.get_default ().register_visible_menu (entry.menu);
247 entry.menu.popup (null,
248 null,
249@@ -233,7 +244,9 @@
250
251 public bool on_motion_event (Clutter.Event e)
252 {
253- if ((entry.menu is Gtk.Menu) && MenuManager.get_default ().menu_is_open ())
254+ if ((entry.menu is Gtk.Menu)
255+ && MenuManager.get_default ().menu_is_open ()
256+ && menu_is_open == false)
257 {
258 show_menu ();
259 return true;
260@@ -310,7 +323,7 @@
261 {
262 return (entry.menu.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0;
263 }
264-
265+
266 private override void paint ()
267 {
268 bg.paint ();
269
270=== modified file 'unity-private/panel/panel-menu-manager.vala'
271--- unity-private/panel/panel-menu-manager.vala 2010-06-18 15:42:52 +0000
272+++ unity-private/panel/panel-menu-manager.vala 2010-07-03 13:30:43 +0000
273@@ -33,7 +33,9 @@
274
275 public void register_visible_menu (Gtk.Menu menu)
276 {
277- if (current_menu is Gtk.Menu && (current_menu.visible == true) && (current_menu != menu))
278+ if (current_menu is Gtk.Menu
279+ && (current_menu.visible == true)
280+ && (current_menu != menu))
281 current_menu.popdown ();
282
283 current_menu = menu;
284@@ -41,7 +43,8 @@
285
286 public void popdown_current_menu ()
287 {
288- current_menu.popdown ();
289+ if (current_menu is Gtk.Menu)
290+ current_menu.popdown ();
291 }
292
293 public bool menu_is_open ()
294
295=== modified file 'unity-private/places/places-default-renderer-group.vala'
296--- unity-private/places/places-default-renderer-group.vala 2010-07-01 15:49:26 +0000
297+++ unity-private/places/places-default-renderer-group.vala 2010-07-03 13:30:43 +0000
298@@ -216,7 +216,7 @@
299
300 private async void clicked_handler ()
301 {
302- debug (@"Launching $uri");
303+ global_shell.hide_unity ();
304
305 if (uri.has_prefix ("application://"))
306 {
307
308=== modified file 'unity-private/places/places-place-bar.vala'
309--- unity-private/places/places-place-bar.vala 2010-06-22 14:00:31 +0000
310+++ unity-private/places/places-place-bar.vala 2010-07-03 13:30:43 +0000
311@@ -46,7 +46,6 @@
312 set_background (bg);
313 bg.show ();
314
315- /* Enable once clutk bug is fixed */
316 glow = new Ctk.EffectGlow ();
317 glow.set_color ({ 255, 255, 255, 255 });
318 glow.set_factor (1.0f);
319
320=== modified file 'unity-private/places/places-place-model.vala'
321--- unity-private/places/places-place-model.vala 2010-06-24 07:43:05 +0000
322+++ unity-private/places/places-place-model.vala 2010-07-03 13:30:43 +0000
323@@ -95,9 +95,12 @@
324 if (place is Place)
325 {
326 place.connect ();
327- (place as GLib.Object).ref ();
328- add (place);
329- place_added (place);
330+ if (place.online == true)
331+ {
332+ (place as GLib.Object).ref ();
333+ add (place);
334+ place_added (place);
335+ }
336 }
337 }
338 }
339
340=== modified file 'unity-private/testing/test-window.vala'
341--- unity-private/testing/test-window.vala 2010-06-22 17:18:49 +0000
342+++ unity-private/testing/test-window.vala 2010-07-03 13:30:43 +0000
343@@ -312,6 +312,16 @@
344 this.places.do_queue_redraw ();
345 }
346
347+ public void hide_unity ()
348+ {
349+ if (showing_places == false)
350+ {
351+ showing_places = true;
352+ panel.set_indicator_mode (false);
353+ places.opacity = 0;
354+ }
355+ }
356+
357 public void about_to_show_places ()
358 {
359 places.about_to_show ();
360
361=== modified file 'unity/shell.vala'
362--- unity/shell.vala 2010-06-22 17:18:49 +0000
363+++ unity/shell.vala 2010-07-03 13:30:43 +0000
364@@ -38,6 +38,7 @@
365 public abstract ShellMode get_mode ();
366 public abstract Clutter.Stage get_stage ();
367 public abstract void show_unity ();
368+ public abstract void hide_unity ();
369 public abstract int get_indicators_width ();
370 public abstract int get_launcher_width_foobar (); // _foobar is used to avoid a symbol-clash
371 public abstract int get_panel_height_foobar (); // with unity/targets/mutter/main.c