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
1=== modified file 'libdbusmenu-glib/menuitem.c'
2--- libdbusmenu-glib/menuitem.c 2010-11-23 22:55:43 +0000
3+++ libdbusmenu-glib/menuitem.c 2010-12-15 19:05:53 +0000
4@@ -70,6 +70,7 @@
5 CHILD_MOVED,
6 REALIZED,
7 SHOW_TO_USER,
8+ ABOUT_TO_SHOW,
9 LAST_SIGNAL
10 };
11
12@@ -229,6 +230,21 @@
13 g_cclosure_marshal_VOID__UINT,
14 G_TYPE_NONE, 1, G_TYPE_UINT, G_TYPE_NONE);
15
16+ /**
17+ DbusmenuMenuitem::about-to-show:
18+ @arg0: The #DbusmenuMenuitem object.
19+
20+ Emitted when the submenu for this item
21+ is about to be shown
22+ */
23+ signals[ABOUT_TO_SHOW] = g_signal_new(DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW,
24+ G_TYPE_FROM_CLASS(klass),
25+ G_SIGNAL_RUN_LAST,
26+ G_STRUCT_OFFSET(DbusmenuMenuitemClass, about_to_show),
27+ NULL, NULL,
28+ _dbusmenu_menuitem_marshal_VOID__VOID,
29+ G_TYPE_BOOLEAN, 0, G_TYPE_NONE);
30+
31 g_object_class_install_property (object_class, PROP_ID,
32 g_param_spec_int(PROP_ID_S, "ID for the menu item",
33 "This is a unique indentifier for the menu item.",
34@@ -398,7 +414,8 @@
35 if (dbusmenu_menuitem_get_children(mi) == NULL) {
36 g_warning("About to Show called on an item wihtout submenus. We're ignoring it.");
37 } else {
38- g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, 0 /* timestamp */, TRUE);
39+ gboolean dummy;
40+ g_signal_emit(G_OBJECT(mi), signals[ABOUT_TO_SHOW], 0, &dummy);
41 }
42
43 if (cb != NULL) {
44
45=== modified file 'libdbusmenu-glib/menuitem.h'
46--- libdbusmenu-glib/menuitem.h 2010-11-18 02:50:45 +0000
47+++ libdbusmenu-glib/menuitem.h 2010-12-15 19:05:53 +0000
48@@ -50,6 +50,7 @@
49 #define DBUSMENU_MENUITEM_SIGNAL_REALIZED "realized"
50 #define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM))
51 #define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER "show-to-user"
52+#define DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW "about-to-show"
53
54 #define DBUSMENU_MENUITEM_PROP_TYPE "type"
55 #define DBUSMENU_MENUITEM_PROP_VISIBLE "visible"
56@@ -158,6 +159,7 @@
57 void (*send_about_to_show) (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);
58
59 void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
60+ gboolean (*about_to_show) (void);
61
62 /*< Private >*/
63 void (*reserved1) (void);
64@@ -165,7 +167,6 @@
65 void (*reserved3) (void);
66 void (*reserved4) (void);
67 void (*reserved5) (void);
68- void (*reserved6) (void);
69 };
70
71 GType dbusmenu_menuitem_get_type (void);
72
73=== modified file 'libdbusmenu-glib/server.c'
74--- libdbusmenu-glib/server.c 2010-11-29 21:19:52 +0000
75+++ libdbusmenu-glib/server.c 2010-12-15 19:05:53 +0000
76@@ -1079,6 +1079,8 @@
77 return;
78 }
79
80+ dbusmenu_menuitem_send_about_to_show(mi, NULL, NULL);
81+
82 /* GTK+ does not support about-to-show concept for now */
83 g_dbus_method_invocation_return_value(invocation,
84 g_variant_new("(b)", FALSE));
85
86=== modified file 'libdbusmenu-gtk/menuitem.h'
87--- libdbusmenu-gtk/menuitem.h 2010-06-14 15:58:21 +0000
88+++ libdbusmenu-gtk/menuitem.h 2010-12-15 19:05:53 +0000
89@@ -35,6 +35,8 @@
90 #include <gdk/gdk.h>
91 #include <gtk/gtk.h>
92
93+G_BEGIN_DECLS
94+
95 gboolean dbusmenu_menuitem_property_set_image (DbusmenuMenuitem * menuitem, const gchar * property, const GdkPixbuf * data);
96 GdkPixbuf * dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * property);
97
98@@ -43,4 +45,6 @@
99 gboolean dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, const GtkMenuItem * gmi);
100 void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifiers);
101
102+G_END_DECLS
103+
104 #endif

Subscribers

People subscribed via source and target branches