Merge lp:~chrisccoulson/libdbusmenu/ffox-fixes into lp:libdbusmenu/0.5

Proposed by David Barth
Status: Merged
Merged at revision: 177
Proposed branch: lp:~chrisccoulson/libdbusmenu/ffox-fixes
Merge into: lp:libdbusmenu/0.5
Diff against target: 104 lines (+26/-2)
4 files modified
libdbusmenu-glib/menuitem.c (+18/-1)
libdbusmenu-glib/menuitem.h (+2/-1)
libdbusmenu-glib/server.c (+2/-0)
libdbusmenu-gtk/menuitem.h (+4/-0)
To merge this branch: bzr merge lp:~chrisccoulson/libdbusmenu/ffox-fixes
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Karl Lattimer (community) Needs Information
Review via email: mp+43810@code.launchpad.net

Description of the change

See the change description in Chris's bug report at https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/690447

To post a comment you must log in.
Revision history for this message
Karl Lattimer (karl-qdh) wrote :

I have one question about this patch, in line 38 you remove the ITEM_ACTIVATED signal. Does anything in existence utilise this signal and would need to be changed to use ABOUT_TO_SHOW instead?

review: Needs Information
Revision history for this message
Ted Gould (ted) wrote :

Karl, you're right in that things will need to change. Mostly what needs to change is appmenu-gtk and libappindicator as they don't connect to the about-to-show signal (yet) and thus only pass that to applications with the activate signal. But, this patch should still go in as we need the feature elsewhere.

Also, I'm not going to merge the "ABI saving" feature of replacing the reserved as the current trunk already breaks the ABI :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libdbusmenu-glib/menuitem.c'
--- libdbusmenu-glib/menuitem.c 2010-11-23 22:55:43 +0000
+++ libdbusmenu-glib/menuitem.c 2010-12-15 19:05:53 +0000
@@ -70,6 +70,7 @@
70 CHILD_MOVED,70 CHILD_MOVED,
71 REALIZED,71 REALIZED,
72 SHOW_TO_USER,72 SHOW_TO_USER,
73 ABOUT_TO_SHOW,
73 LAST_SIGNAL74 LAST_SIGNAL
74};75};
7576
@@ -229,6 +230,21 @@
229 g_cclosure_marshal_VOID__UINT,230 g_cclosure_marshal_VOID__UINT,
230 G_TYPE_NONE, 1, G_TYPE_UINT, G_TYPE_NONE);231 G_TYPE_NONE, 1, G_TYPE_UINT, G_TYPE_NONE);
231232
233 /**
234 DbusmenuMenuitem::about-to-show:
235 @arg0: The #DbusmenuMenuitem object.
236
237 Emitted when the submenu for this item
238 is about to be shown
239 */
240 signals[ABOUT_TO_SHOW] = g_signal_new(DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW,
241 G_TYPE_FROM_CLASS(klass),
242 G_SIGNAL_RUN_LAST,
243 G_STRUCT_OFFSET(DbusmenuMenuitemClass, about_to_show),
244 NULL, NULL,
245 _dbusmenu_menuitem_marshal_VOID__VOID,
246 G_TYPE_BOOLEAN, 0, G_TYPE_NONE);
247
232 g_object_class_install_property (object_class, PROP_ID,248 g_object_class_install_property (object_class, PROP_ID,
233 g_param_spec_int(PROP_ID_S, "ID for the menu item",249 g_param_spec_int(PROP_ID_S, "ID for the menu item",
234 "This is a unique indentifier for the menu item.",250 "This is a unique indentifier for the menu item.",
@@ -398,7 +414,8 @@
398 if (dbusmenu_menuitem_get_children(mi) == NULL) {414 if (dbusmenu_menuitem_get_children(mi) == NULL) {
399 g_warning("About to Show called on an item wihtout submenus. We're ignoring it.");415 g_warning("About to Show called on an item wihtout submenus. We're ignoring it.");
400 } else {416 } else {
401 g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, 0 /* timestamp */, TRUE);417 gboolean dummy;
418 g_signal_emit(G_OBJECT(mi), signals[ABOUT_TO_SHOW], 0, &dummy);
402 }419 }
403420
404 if (cb != NULL) {421 if (cb != NULL) {
405422
=== modified file 'libdbusmenu-glib/menuitem.h'
--- libdbusmenu-glib/menuitem.h 2010-11-18 02:50:45 +0000
+++ libdbusmenu-glib/menuitem.h 2010-12-15 19:05:53 +0000
@@ -50,6 +50,7 @@
50#define DBUSMENU_MENUITEM_SIGNAL_REALIZED "realized"50#define DBUSMENU_MENUITEM_SIGNAL_REALIZED "realized"
51#define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM))51#define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM))
52#define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER "show-to-user"52#define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER "show-to-user"
53#define DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW "about-to-show"
5354
54#define DBUSMENU_MENUITEM_PROP_TYPE "type"55#define DBUSMENU_MENUITEM_PROP_TYPE "type"
55#define DBUSMENU_MENUITEM_PROP_VISIBLE "visible"56#define DBUSMENU_MENUITEM_PROP_VISIBLE "visible"
@@ -158,6 +159,7 @@
158 void (*send_about_to_show) (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);159 void (*send_about_to_show) (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);
159160
160 void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);161 void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
162 gboolean (*about_to_show) (void);
161163
162 /*< Private >*/164 /*< Private >*/
163 void (*reserved1) (void);165 void (*reserved1) (void);
@@ -165,7 +167,6 @@
165 void (*reserved3) (void);167 void (*reserved3) (void);
166 void (*reserved4) (void);168 void (*reserved4) (void);
167 void (*reserved5) (void);169 void (*reserved5) (void);
168 void (*reserved6) (void);
169};170};
170171
171GType dbusmenu_menuitem_get_type (void);172GType dbusmenu_menuitem_get_type (void);
172173
=== modified file 'libdbusmenu-glib/server.c'
--- libdbusmenu-glib/server.c 2010-11-29 21:19:52 +0000
+++ libdbusmenu-glib/server.c 2010-12-15 19:05:53 +0000
@@ -1079,6 +1079,8 @@
1079 return;1079 return;
1080 }1080 }
10811081
1082 dbusmenu_menuitem_send_about_to_show(mi, NULL, NULL);
1083
1082 /* GTK+ does not support about-to-show concept for now */1084 /* GTK+ does not support about-to-show concept for now */
1083 g_dbus_method_invocation_return_value(invocation,1085 g_dbus_method_invocation_return_value(invocation,
1084 g_variant_new("(b)", FALSE));1086 g_variant_new("(b)", FALSE));
10851087
=== modified file 'libdbusmenu-gtk/menuitem.h'
--- libdbusmenu-gtk/menuitem.h 2010-06-14 15:58:21 +0000
+++ libdbusmenu-gtk/menuitem.h 2010-12-15 19:05:53 +0000
@@ -35,6 +35,8 @@
35#include <gdk/gdk.h>35#include <gdk/gdk.h>
36#include <gtk/gtk.h>36#include <gtk/gtk.h>
3737
38G_BEGIN_DECLS
39
38gboolean dbusmenu_menuitem_property_set_image (DbusmenuMenuitem * menuitem, const gchar * property, const GdkPixbuf * data);40gboolean dbusmenu_menuitem_property_set_image (DbusmenuMenuitem * menuitem, const gchar * property, const GdkPixbuf * data);
39GdkPixbuf * dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * property);41GdkPixbuf * dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * property);
4042
@@ -43,4 +45,6 @@
43gboolean dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, const GtkMenuItem * gmi);45gboolean dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, const GtkMenuItem * gmi);
44void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifiers);46void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifiers);
4547
48G_END_DECLS
49
46#endif50#endif

Subscribers

People subscribed via source and target branches