Merge lp:~mterry/unity/never-stop-oh-never-stop-the-scrubbing into lp:unity

Proposed by Michael Terry
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 791
Proposed branch: lp:~mterry/unity/never-stop-oh-never-stop-the-scrubbing
Merge into: lp:unity
Diff against target: 31 lines (+17/-2)
1 file modified
services/panel-service.c (+17/-2)
To merge this branch: bzr merge lp:~mterry/unity/never-stop-oh-never-stop-the-scrubbing
Reviewer Review Type Date Requested Status
Gord Allott Pending
Review via email: mp+47581@code.launchpad.net

Description of the change

This branch lets the panel service handle IndicatorObjectEntries without menus gracefully. This is follow on work from an indicator-appmenu fix [1].

Basically, if the panel service finds itself with a menu-less entry, it previously halted a scrub in its tracks. To avoid that, I just create a dummy GtkMenu for the duration of the scrub.

In practice, we should rarely if ever hit this. But for the moment, when an application swaps out a toplevel menu, indicator-appmenu is able to remove it, but not put the new one in place. So you'll see this, for example, in empathy, if you open a contact window and scrub across the "Contact" menu item. You'll need [1] though or you'll just crash instead.

[1] https://code.launchpad.net/~mterry/indicator-appmenu/fix-empathy-contact-crash/+merge/47579

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'services/panel-service.c'
--- services/panel-service.c 2010-12-29 17:30:12 +0000
+++ services/panel-service.c 2011-01-26 19:58:23 +0000
@@ -977,10 +977,25 @@
977 priv->last_menu_button = 0;977 priv->last_menu_button = 0;
978 }978 }
979979
980 if (entry != NULL && GTK_IS_MENU (entry->menu))980 if (entry != NULL)
981 {981 {
982 if (GTK_IS_MENU (entry->menu))
983 {
984 priv->last_menu = entry->menu;
985 }
986 else
987 {
988 /* For some reason, this entry doesn't have a menu. To simplify the
989 rest of the code and to keep scrubbing fluidly, we'll create a
990 stub menu for the duration of this scrub. */
991 priv->last_menu = GTK_MENU (gtk_menu_new ());
992 g_signal_connect (priv->last_menu, "deactivate",
993 G_CALLBACK (gtk_widget_destroy), NULL);
994 g_signal_connect (priv->last_menu, "destroy",
995 G_CALLBACK (gtk_widget_destroyed), &priv->last_menu);
996 }
997
982 priv->last_entry = entry;998 priv->last_entry = entry;
983 priv->last_menu = entry->menu;
984 priv->last_x = x;999 priv->last_x = x;
985 priv->last_y = y;1000 priv->last_y = y;
986 priv->last_menu_button = button;1001 priv->last_menu_button = button;