Merge lp:~didrocks/unity/launcher-fixes into lp:unity

Proposed by Didier Roche on 2011-03-16
Status: Merged
Approved by: Mirco Müller on 2011-03-16
Approved revision: 953
Merged at revision: 959
Proposed branch: lp:~didrocks/unity/launcher-fixes
Merge into: lp:unity
Diff against target: 651 lines (+228/-141)
7 files modified
com.canonical.Unity.gschema.xml (+1/-1)
src/Launcher.cpp (+178/-129)
src/Launcher.h (+24/-7)
src/LauncherController.cpp (+4/-3)
src/LauncherController.h (+1/-1)
src/unityshell.cpp (+17/-0)
src/unityshell.h (+3/-0)
To merge this branch: bzr merge lp:~didrocks/unity/launcher-fixes
Reviewer Review Type Date Requested Status
Mirco Müller (community) 2011-03-16 Approve on 2011-03-16
Review via email: mp+53588@code.launchpad.net

Description of the change

This branch:
* Fix some false-positive when the check call isn't refresh on ws change (LP:
#730679)
* enable adding a new desktop file with the dbus call (LP: #670403)
* add another drag icon action: pressing for 500ms on a launcher icon would
decouple it from the Launcher. Clean some other code as well (LP: #727922)
* do some cleanup on the launcher code as well

To post a comment you must log in.
lp:~didrocks/unity/launcher-fixes updated on 2011-03-16
953. By Didier Roche on 2011-03-16

enlarge the dead zone to a 3x3 square (LP: #736034)

Mirco Müller (macslow) wrote :

This branch disables the Press&Hold activation for the Quicklist.

review: Needs Fixing
Didier Roche (didrocks) wrote :

As discussed on IRC, the Press&Hold should only happen with the touch framework, not the mouse one and it's not implemented yet.

Mirco Müller (macslow) wrote :

Ok, approved then. I only wish we would have not wasted time on this before.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'com.canonical.Unity.gschema.xml'
2--- com.canonical.Unity.gschema.xml 2011-03-07 15:25:13 +0000
3+++ com.canonical.Unity.gschema.xml 2011-03-16 10:54:46 +0000
4@@ -14,7 +14,7 @@
5 </schema>
6 <schema path="/desktop/unity/launcher/" id="com.canonical.Unity.Launcher" gettext-domain="unity">
7 <key type="as" name="favorites">
8- <default>[ 'ubiquity-gtkui.desktop', 'nautilus-home.desktop', 'firefox.desktop', 'ubuntuone-control-panel-gtk.desktop', 'tomboy.desktop' ]</default>
9+ <default>[ 'ubiquity-gtkui.desktop', 'nautilus-home.desktop', 'firefox.desktop', 'libreoffice-writer.desktop', 'libreoffice-calc.desktop', 'libreoffice-impress.desktop', 'ubuntu-software-center.desktop', 'ubuntuone-control-panel-gtk.desktop' ]</default>
10 <summary>List of desktop file ids for favorites on the launcher.</summary>
11 <description>These applications are shown in the Launcher by default.</description>
12 </key>
13
14=== modified file 'src/Launcher.cpp'
15--- src/Launcher.cpp 2011-03-11 16:59:00 +0000
16+++ src/Launcher.cpp 2011-03-16 10:54:46 +0000
17@@ -51,6 +51,10 @@
18
19 #define BACKLIGHT_STRENGTH 0.9f
20
21+#define S_DBUS_NAME "com.canonical.Unity.Launcher"
22+#define S_DBUS_PATH "/com/canonical/Unity/Launcher"
23+#define S_DBUS_IFACE "com.canonical.Unity.Launcher"
24+
25 NUX_IMPLEMENT_OBJECT_TYPE (Launcher);
26
27 int
28@@ -72,6 +76,30 @@
29 timeref->tv_nsec -= remove * 1000000;
30 }
31
32+const gchar Launcher::introspection_xml[] =
33+ "<node>"
34+ " <interface name='com.canonical.Unity.Launcher'>"
35+ ""
36+ " <method name='AddLauncherItemFromPosition'>"
37+ " <arg type='s' name='icon' direction='in'/>"
38+ " <arg type='s' name='title' direction='in'/>"
39+ " <arg type='i' name='icon_x' direction='in'/>"
40+ " <arg type='i' name='icon_y' direction='in'/>"
41+ " <arg type='i' name='icon_size' direction='in'/>"
42+ " <arg type='s' name='desktop_file' direction='in'/>"
43+ " <arg type='s' name='aptdaemon_task' direction='in'/>"
44+ " </method>"
45+ ""
46+ " </interface>"
47+ "</node>";
48+
49+GDBusInterfaceVTable Launcher::interface_vtable =
50+{
51+ Launcher::handle_dbus_method_call,
52+ NULL,
53+ NULL
54+};
55+
56
57 /*
58 Use this shader to pass vertices in screen coordinates in the C++ code and compute use
59@@ -303,9 +331,8 @@
60 _autohide_handle = 0;
61 _autoscroll_handle = 0;
62 _redraw_handle = 0;
63+ _start_dragicon_handle = 0;
64 _focus_keynav_handle = 0;
65- _single_finger_hold_handle = 0;
66- _single_finger_hold_timer = NULL;
67 _floating = false;
68 _hovered = false;
69 _hidden = false;
70@@ -355,6 +382,15 @@
71 ubus_server_register_interest (ubus, UBUS_LAUNCHER_ACTION_DONE,
72 (UBusCallback)&Launcher::OnActionDone,
73 this);
74+
75+ _dbus_owner = g_bus_own_name (G_BUS_TYPE_SESSION,
76+ S_DBUS_NAME,
77+ (GBusNameOwnerFlags) (G_BUS_NAME_OWNER_FLAGS_REPLACE | G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT),
78+ OnBusAcquired,
79+ OnNameAcquired,
80+ OnNameLost,
81+ this,
82+ NULL);
83
84 SetDndEnabled (false, true);
85 }
86@@ -366,6 +402,7 @@
87 if (_superkey_labels[i])
88 _superkey_labels[i]->UnReference ();
89 }
90+ g_bus_unown_name (_dbus_owner);
91 }
92
93 /* Introspection */
94@@ -608,11 +645,6 @@
95 return pow (1.0f - CLAMP ((float) (TimeDelta (&current, &_times[TIME_DRAG_END])) / (float) ANIM_DURATION_LONG, 0.0f, 1.0f), 2);
96 }
97
98-float Launcher::DnDStartProgress (struct timespec const &current)
99-{
100- return CLAMP ((float) (TimeDelta (&current, &_times[TIME_DRAG_START])) / (float) ANIM_DURATION, 0.0f, 1.0f);
101-}
102-
103 float Launcher::AutohideProgress (struct timespec const &current)
104 {
105
106@@ -624,7 +656,7 @@
107 return 0.0f;
108
109 // "dead" zone
110- if ((_trigger_mouse_position.x < 2) && (_trigger_mouse_position.y < 2))
111+ if ((_trigger_mouse_position.x < 3) && (_trigger_mouse_position.y < 3))
112 return GetAutohidePositionMin ();
113
114 /*
115@@ -749,10 +781,6 @@
116 // hover out animation
117 if (TimeDelta (&current, &_times[TIME_LEAVE]) < ANIM_DURATION)
118 return true;
119-
120- // drag start animation
121- if (TimeDelta (&current, &_times[TIME_DRAG_START]) < ANIM_DURATION)
122- return true;
123
124 // drag end animation
125 if (TimeDelta (&current, &_times[TIME_DRAG_END]) < ANIM_DURATION_LONG)
126@@ -1442,7 +1470,7 @@
127 {
128 if (hidden == _hidden)
129 return;
130-
131+
132 // auto lock/unlock the launcher depending on the state switch
133 if (hidden)
134 {
135@@ -1487,21 +1515,6 @@
136 return _mouse_position.y;
137 }
138
139-gboolean
140-Launcher::SingleFingerHoldTimeout (gpointer data)
141-{
142- Launcher* self = NULL;
143- LauncherIcon* launcher_icon = NULL;
144-
145- self = (Launcher*) data;
146- launcher_icon = self->MouseIconIntersection (self->GetMouseX (),
147- self->GetMouseY ());
148- if (launcher_icon)
149- launcher_icon->OpenQuicklist ();
150-
151- return false;
152-}
153-
154 gboolean Launcher::DrawLauncherTimeout (gpointer data)
155 {
156 Launcher *self = (Launcher*) data;
157@@ -1542,7 +1555,7 @@
158 if (!window || !(window->type () & intersect_types) || !window->isMapped () || !window->isViewable ())
159 return false;
160
161- if (CompRegion (window->serverInputRect ()).intersects (CompRect (geo.x, geo.y, geo.width, geo.height)))
162+ if (CompRegion (window->inputRect ()).intersects (CompRect (geo.x, geo.y, geo.width, geo.height)))
163 return true;
164
165 return false;
166@@ -2337,42 +2350,31 @@
167 guint64 shortcut = arg.icon->GetShortcut ();
168
169 /* deal with dynamic labels for places, which can be set via the locale */
170- if (shortcut != 0 && !g_ascii_isdigit ((gchar) shortcut))
171- {
172- RenderIcon (GfxContext,
173- arg,
174- arg.icon->GetSuperkeyLabel ()->GetDeviceTexture (),
175- nux::Color (0xFFFFFFFF),
176- arg.alpha,
177- arg.icon->_xform_coords["Tile"]);
178- }
179- else
180- {
181- /* deal with the hardcoded labels used for the first 10 icons on the launcher */
182- gchar key = (gchar) shortcut;
183- int index = -1;
184-
185- switch (key)
186+ if (shortcut != 0)
187+ {
188+ if (!g_ascii_isdigit ((gchar) shortcut))
189 {
190- case '1': index = 0; break;
191- case '2': index = 1; break;
192- case '3': index = 2; break;
193- case '4': index = 3; break;
194- case '5': index = 4; break;
195- case '6': index = 5; break;
196- case '7': index = 6; break;
197- case '8': index = 7; break;
198- case '9': index = 8; break;
199- case '0': index = 9; break;
200+ RenderIcon (GfxContext,
201+ arg,
202+ arg.icon->GetSuperkeyLabel ()->GetDeviceTexture (),
203+ nux::Color (0xFFFFFFFF),
204+ arg.alpha,
205+ arg.icon->_xform_coords["Tile"]);
206 }
207-
208- if (index != -1)
209+ else
210+ {
211+ /* deal with the hardcoded labels used for the first 10 icons on the launcher */
212+ gchar *shortcut_str = g_strdup_printf ("%c", (gchar)shortcut);
213+ int index = (atoi (shortcut_str) + 9) % 10; // Not -1 as -1 % 10 = -1…
214+ g_free (shortcut_str);
215+
216 RenderIcon (GfxContext,
217 arg,
218 _superkey_labels[index]->GetDeviceTexture (),
219 nux::Color (0xFFFFFFFF),
220 arg.alpha,
221 arg.icon->_xform_coords["Tile"]);
222+ }
223 }
224 }
225 }
226@@ -2499,6 +2501,31 @@
227 EnsureAnimation ();
228 }
229
230+
231+gboolean Launcher::StartIconDragTimeout (gpointer data)
232+{
233+ Launcher *self = (Launcher*) data;
234+
235+ // if we are still waiting…
236+ if (self->GetActionState () == ACTION_NONE)
237+ self->StartIconDragRequest (self->GetMouseX (), self->GetMouseY ());
238+ return false;
239+}
240+
241+void Launcher::StartIconDragRequest (int x, int y)
242+{
243+ LauncherIcon *drag_icon = MouseIconIntersection ((int) (GetGeometry ().x / 2.0f), y);
244+
245+ // FIXME: nux doesn't give nux::GetEventButton (button_flags) there, relying
246+ // on an internal Launcher property then
247+ if (drag_icon && (_last_button_press == 1) && _model->IconHasSister (drag_icon))
248+ {
249+ StartIconDrag (drag_icon);
250+ SetActionState (ACTION_DRAG_ICON);
251+ UpdateDragWindowPosition (x, y);
252+ }
253+}
254+
255 void Launcher::StartIconDrag (LauncherIcon *icon)
256 {
257 if (!icon)
258@@ -2612,8 +2639,6 @@
259
260 if (GetActionState () == ACTION_NONE)
261 {
262- SetTimeStruct (&_times[TIME_DRAG_START]);
263-
264 if (nux::Abs (_dnd_delta_y) >= nux::Abs (_dnd_delta_x))
265 {
266 _launcher_drag_delta += _dnd_delta_y;
267@@ -2621,17 +2646,7 @@
268 }
269 else
270 {
271- LauncherIcon *drag_icon = MouseIconIntersection ((int) (GetGeometry ().x / 2.0f), y);
272-
273- // FIXME: nux doesn't give nux::GetEventButton (button_flags) there, relying
274- // on an internal Launcher property then
275- if (drag_icon && (_last_button_press == 1) && _model->IconHasSister (drag_icon))
276- {
277- StartIconDrag (drag_icon);
278- SetActionState (ACTION_DRAG_ICON);
279- UpdateDragWindowPosition (x, y);
280- }
281-
282+ StartIconDragRequest (x, y);
283 }
284 }
285 else if (GetActionState () == ACTION_DRAG_LAUNCHER)
286@@ -2883,21 +2898,14 @@
287 LauncherIcon* launcher_icon = 0;
288 launcher_icon = MouseIconIntersection (_mouse_position.x, _mouse_position.y);
289
290- // this takes care of the one-finger-hold "event" on a launcher-icon
291- if (_single_finger_hold_handle == 0)
292- {
293- _single_finger_hold_handle = g_timeout_add (SINGLE_FINGER_HOLD_DURATION,
294- &Launcher::SingleFingerHoldTimeout,
295- this);
296- if (_single_finger_hold_timer)
297- g_timer_destroy (_single_finger_hold_timer);
298-
299- _single_finger_hold_timer = g_timer_new ();
300- }
301-
302 if (launcher_icon)
303 {
304 _icon_mouse_down = launcher_icon;
305+ // if MouseUp after the time ended -> it's an icon drag, otherwise, it's starting an app
306+ if (_start_dragicon_handle > 0)
307+ g_source_remove (_start_dragicon_handle);
308+ _start_dragicon_handle = g_timeout_add (START_DRAGICON_DURATION, &Launcher::StartIconDragTimeout, this);
309+
310 launcher_icon->MouseDown.emit (nux::GetEventButton (button_flags));
311 }
312 }
313@@ -2905,59 +2913,20 @@
314 void Launcher::MouseUpLogic (int x, int y, unsigned long button_flags, unsigned long key_flags)
315 {
316 LauncherIcon* launcher_icon = 0;
317+
318 launcher_icon = MouseIconIntersection (_mouse_position.x, _mouse_position.y);
319-
320- // this takes care of the one-finger-hold "event" on a launcher-icon
321- if (_single_finger_hold_timer)
322- {
323- // user "released" before single-finger-hold threshold
324- if (g_timer_elapsed (_single_finger_hold_timer, NULL) < (float) SINGLE_FINGER_HOLD_DURATION / 1000.0)
325- {
326-
327- // remove callback
328- if (_single_finger_hold_handle > 0)
329- {
330- g_source_remove (_single_finger_hold_handle);
331- _single_finger_hold_handle = 0;
332- }
333- }
334- // user "released" after single-finger-hold threshold...
335- else
336- {
337- // remove timer
338- g_timer_destroy (_single_finger_hold_timer);
339- _single_finger_hold_timer = NULL;
340-
341- // remove callback
342- if (_single_finger_hold_handle > 0)
343- {
344- g_source_remove (_single_finger_hold_handle);
345- _single_finger_hold_handle = 0;
346- }
347-
348- // ... don't start app, just return
349- _icon_mouse_down = 0;
350- return;
351- }
352-
353- // remove timer
354- g_timer_destroy (_single_finger_hold_timer);
355- _single_finger_hold_timer = NULL;
356-
357- // remove callback
358- if (_single_finger_hold_handle > 0)
359- {
360- g_source_remove (_single_finger_hold_handle);
361- _single_finger_hold_handle = 0;
362- }
363- }
364+
365+ if (_start_dragicon_handle > 0)
366+ g_source_remove (_start_dragicon_handle);
367+ _start_dragicon_handle = 0;
368
369 if (_icon_mouse_down && (_icon_mouse_down == launcher_icon))
370 {
371 _icon_mouse_down->MouseUp.emit (nux::GetEventButton (button_flags));
372
373- if (GetActionState () == ACTION_NONE)
374+ if (GetActionState () == ACTION_NONE) {
375 _icon_mouse_down->MouseClick.emit (nux::GetEventButton (button_flags));
376+ }
377 }
378
379 if (launcher_icon && (_icon_mouse_down != launcher_icon))
380@@ -3658,7 +3627,7 @@
381
382 if (path)
383 {
384- launcher_dropped.emit (path, _dnd_hovered_icon);
385+ launcher_addrequest.emit (path, _dnd_hovered_icon);
386 g_free (path);
387 }
388 }
389@@ -3696,3 +3665,83 @@
390 else
391 return NULL;
392 }
393+
394+/* dbus handlers */
395+
396+void
397+Launcher::handle_dbus_method_call (GDBusConnection *connection,
398+ const gchar *sender,
399+ const gchar *object_path,
400+ const gchar *interface_name,
401+ const gchar *method_name,
402+ GVariant *parameters,
403+ GDBusMethodInvocation *invocation,
404+ gpointer user_data)
405+{
406+
407+ if (g_strcmp0 (method_name, "AddLauncherItemFromPosition") == 0)
408+ {
409+ gchar *icon;
410+ gchar *title;
411+ gint32 icon_x;
412+ gint32 icon_y;
413+ gint32 icon_size;
414+ gchar *desktop_file;
415+ gchar *aptdaemon_task;
416+
417+ g_variant_get (parameters, "(ssiiiss)", &icon, &title, &icon_x, &icon_y, &icon_size, &desktop_file, &aptdaemon_task, NULL);
418+
419+ Launcher *self = (Launcher*)user_data;
420+ self->launcher_addrequest.emit (desktop_file, NULL);
421+
422+ g_dbus_method_invocation_return_value (invocation, NULL);
423+ g_free (icon);
424+ g_free (title);
425+ g_free (desktop_file);
426+ g_free (aptdaemon_task);
427+ }
428+
429+}
430+
431+void
432+Launcher::OnBusAcquired (GDBusConnection *connection,
433+ const gchar *name,
434+ gpointer user_data)
435+{
436+ GDBusNodeInfo *introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
437+ guint registration_id;
438+
439+ if (!introspection_data) {
440+ g_warning ("No introspection data loaded. Won't get dynamic launcher addition.");
441+ return;
442+ }
443+
444+
445+
446+ registration_id = g_dbus_connection_register_object (connection,
447+ S_DBUS_PATH,
448+ introspection_data->interfaces[0],
449+ &interface_vtable,
450+ user_data,
451+ NULL,
452+ NULL);
453+ if (!registration_id)
454+ g_warning ("Object registration failed. Won't get dynamic launcher addition.");
455+
456+}
457+
458+void
459+Launcher::OnNameAcquired (GDBusConnection *connection,
460+ const gchar *name,
461+ gpointer user_data)
462+{
463+ g_debug ("Acquired the name %s on the session bus\n", name);
464+}
465+
466+void
467+Launcher::OnNameLost (GDBusConnection *connection,
468+ const gchar *name,
469+ gpointer user_data)
470+{
471+ g_debug ("Lost the name %s on the session bus\n", name);
472+}
473
474=== modified file 'src/Launcher.h'
475--- src/Launcher.h 2011-03-07 17:02:59 +0000
476+++ src/Launcher.h 2011-03-16 10:54:46 +0000
477@@ -39,7 +39,7 @@
478 #define ANIM_DURATION_LONG 350
479
480 #define SUPER_TAP_DURATION 250
481-#define SINGLE_FINGER_HOLD_DURATION 1000
482+#define START_DRAGICON_DURATION 500
483
484 #define MAX_SUPERKEY_LABELS 10
485
486@@ -154,8 +154,10 @@
487
488 int GetMouseX ();
489 int GetMouseY ();
490+
491+ void CheckWindowOverLauncher ();
492
493- sigc::signal<void, char *, LauncherIcon *> launcher_dropped;
494+ sigc::signal<void, char *, LauncherIcon *> launcher_addrequest;
495 sigc::signal<void> selection_change;
496 protected:
497 // Introspectable methods
498@@ -179,7 +181,6 @@
499 {
500 TIME_ENTER,
501 TIME_LEAVE,
502- TIME_DRAG_START,
503 TIME_DRAG_END,
504 TIME_DRAG_THRESHOLD,
505 TIME_AUTOHIDE,
506@@ -223,7 +224,7 @@
507 static gboolean DrawLauncherTimeout (gpointer data);
508 static gboolean StrutHack (gpointer data);
509 static gboolean MoveFocusToKeyNavModeTimeout (gpointer data);
510- static gboolean SingleFingerHoldTimeout (gpointer data);
511+ static gboolean StartIconDragTimeout (gpointer data);
512
513 void SetMousePosition (int x, int y);
514
515@@ -252,7 +253,6 @@
516 static gboolean OnScrollTimeout (gpointer data);
517 static gboolean OnUpdateDragManagerTimeout (gpointer data);
518
519- void CheckWindowOverLauncher ();
520 bool CheckIntersectWindow (CompWindow *window);
521
522 float DnDStartProgress (struct timespec const &current);
523@@ -343,6 +343,7 @@
524 void MouseDownLogic (int x, int y, unsigned long button_flags, unsigned long key_flags);
525 void MouseUpLogic (int x, int y, unsigned long button_flags, unsigned long key_flags);
526
527+ void StartIconDragRequest (int x, int y);
528 void StartIconDrag (LauncherIcon *icon);
529 void EndIconDrag ();
530 void UpdateDragWindowPosition (int x, int y);
531@@ -461,8 +462,7 @@
532 guint _autoscroll_handle;
533 guint _focus_keynav_handle;
534 guint _redraw_handle;
535- guint _single_finger_hold_handle;
536- GTimer* _single_finger_hold_timer;
537+ guint _start_dragicon_handle;
538
539 nux::Point2 _mouse_position;
540 nux::Point2 _trigger_mouse_position;
541@@ -483,6 +483,23 @@
542 LauncherIcon *_dnd_hovered_icon;
543
544 Atom _selection_atom;
545+
546+ /* gdbus */
547+ guint _dbus_owner;
548+ static const gchar introspection_xml[];
549+ static GDBusInterfaceVTable interface_vtable;
550+
551+ static void OnBusAcquired (GDBusConnection *connection, const gchar *name, gpointer user_data);
552+ static void OnNameAcquired (GDBusConnection *connection, const gchar *name, gpointer user_data);
553+ static void OnNameLost (GDBusConnection *connection, const gchar *name, gpointer user_data);
554+ static void handle_dbus_method_call (GDBusConnection *connection,
555+ const gchar *sender,
556+ const gchar *object_path,
557+ const gchar *interface_name,
558+ const gchar *method_name,
559+ GVariant *parameters,
560+ GDBusMethodInvocation *invocation,
561+ gpointer user_data);
562
563 struct timespec _times[TIME_LAST];
564 };
565
566=== modified file 'src/LauncherController.cpp'
567--- src/LauncherController.cpp 2011-02-28 15:51:59 +0000
568+++ src/LauncherController.cpp 2011-03-16 10:54:46 +0000
569@@ -38,7 +38,7 @@
570 _sort_priority = 0;
571
572 _launcher->SetModel (_model);
573- _launcher->launcher_dropped.connect (sigc::mem_fun (this, &LauncherController::OnLauncherDropped));
574+ _launcher->launcher_addrequest.connect (sigc::mem_fun (this, &LauncherController::OnLauncherAddRequest));
575 _favorite_store = FavoriteStore::GetDefault ();
576
577 _place_section = new PlaceLauncherSection (_launcher);
578@@ -69,7 +69,7 @@
579 }
580
581 void
582-LauncherController::OnLauncherDropped (char *path, LauncherIcon *before)
583+LauncherController::OnLauncherAddRequest (char *path, LauncherIcon *before)
584 {
585 std::list<BamfLauncherIcon *> launchers;
586 std::list<BamfLauncherIcon *>::iterator it;
587@@ -85,7 +85,8 @@
588 if (result)
589 {
590 RegisterIcon (result);
591- _model->ReorderBefore (result, before, false);
592+ if (before)
593+ _model->ReorderBefore (result, before, false);
594 }
595 }
596
597
598=== modified file 'src/LauncherController.h'
599--- src/LauncherController.h 2011-02-15 22:51:36 +0000
600+++ src/LauncherController.h 2011-03-16 10:54:46 +0000
601@@ -69,7 +69,7 @@
602
603 void OnIconAdded (LauncherIcon *icon);
604
605- void OnLauncherDropped (char *path, LauncherIcon *before);
606+ void OnLauncherAddRequest (char *path, LauncherIcon *before);
607
608 void OnLauncerEntryRemoteAdded (LauncherEntryRemote *entry);
609 void OnLauncerEntryRemoteRemoved (LauncherEntryRemote *entry);
610
611=== modified file 'src/unityshell.cpp'
612--- src/unityshell.cpp 2011-03-10 15:39:00 +0000
613+++ src/unityshell.cpp 2011-03-16 10:54:46 +0000
614@@ -210,6 +210,23 @@
615 }
616 }
617
618+void
619+UnityScreen::handleCompizEvent (const char *plugin,
620+ const char *event,
621+ CompOption::Vector &option)
622+{
623+ if (strcmp (event, "end_viewport_switch") == 0)
624+ {
625+ // compute again the list of all window on the new viewport
626+ // to decide if we should or not hide the launcher
627+ launcher->CheckWindowOverLauncher ();
628+ }
629+
630+
631+ screen->handleCompizEvent (plugin, event, option);
632+
633+}
634+
635 bool
636 UnityScreen::showLauncherKeyInitiate (CompAction *action,
637 CompAction::State state,
638
639=== modified file 'src/unityshell.h'
640--- src/unityshell.h 2011-03-09 19:12:37 +0000
641+++ src/unityshell.h 2011-03-16 10:54:46 +0000
642@@ -95,6 +95,9 @@
643
644 /* handle X11 events */
645 void handleEvent (XEvent *);
646+ void handleCompizEvent (const char *plugin,
647+ const char *event,
648+ CompOption::Vector &option);
649
650 bool
651 showLauncherKeyInitiate (CompAction *action, CompAction::State state,