Merge lp:~3v1n0/libindicator/secondary-activate-support into lp:libindicator/0.4

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 426
Proposed branch: lp:~3v1n0/libindicator/secondary-activate-support
Merge into: lp:libindicator/0.4
Diff against target: 94 lines (+27/-3)
3 files modified
libindicator/indicator-object-marshal.list (+1/-0)
libindicator/indicator-object.c (+22/-2)
libindicator/indicator-object.h (+4/-1)
To merge this branch: bzr merge lp:~3v1n0/libindicator/secondary-activate-support
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+68393@code.launchpad.net

Description of the change

Add support to "secondary-activate" event, needed by both bug #609860 and bug #812933. See the latest for more informations.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

It seems to me that there isn't a reason we need the X and Y information. The only reason that'd be useful is to present a menu, which is something we don't want people to do.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I've explained the reason in the bug report, the fact is that the StatusNotifierItem SecondaryActivate method needs these values [1], and I export them to follow that specification.

[1] http://www.notmart.org/misc/statusnotifieritem/statusnotifieritem.html#SecondaryActivate

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

While, in general, I think that we should work towards matching the SNI spec, I think that this is an exception. The behavior that we're going to get is applications that use this signal in a way that we're not comfortable with will work poorly on Ubuntu and ruin the overall experience. We have no way to detect what the application is going to do with the signal, so we must error on the side of not sending it.

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

To be clear, in libappindicator we can accept it an use it like the other signals. But we should not send it from indicator-application.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

In libappindicator we're not using a signal anymore... In indicator-application we're using that value for sending the right SecondaryActivate method, I guess it's needed by non-ubuntu indicators (for kde apps ones?)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libindicator/indicator-object-marshal.list'
--- libindicator/indicator-object-marshal.list 2011-07-02 02:13:05 +0000
+++ libindicator/indicator-object-marshal.list 2011-07-19 15:05:07 +0000
@@ -2,3 +2,4 @@
2VOID: POINTER, UINT, ENUM2VOID: POINTER, UINT, ENUM
3VOID: POINTER, UINT3VOID: POINTER, UINT
4VOID: POINTER, BOOLEAN4VOID: POINTER, BOOLEAN
5VOID: POINTER, UINT, INT, INT
56
=== modified file 'libindicator/indicator-object.c'
--- libindicator/indicator-object.c 2011-07-08 00:39:59 +0000
+++ libindicator/indicator-object.c 2011-07-19 15:05:07 +0000
@@ -63,6 +63,7 @@
63 MENU_SHOW,63 MENU_SHOW,
64 SHOW_NOW_CHANGED,64 SHOW_NOW_CHANGED,
65 ACCESSIBLE_DESC_UPDATE,65 ACCESSIBLE_DESC_UPDATE,
66 SECONDARY_ACTIVATE,
66 LAST_SIGNAL67 LAST_SIGNAL
67};68};
6869
@@ -149,8 +150,7 @@
149 NULL, NULL,150 NULL, NULL,
150 _indicator_object_marshal_VOID__POINTER_UINT_UINT,151 _indicator_object_marshal_VOID__POINTER_UINT_UINT,
151 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_NONE);152 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_NONE);
152153 /**
153/**
154 IndicatorObject::entry-scrolled:154 IndicatorObject::entry-scrolled:
155 @arg0: The #IndicatorObject object155 @arg0: The #IndicatorObject object
156 @arg1: A pointer to the #IndicatorObjectEntry that156 @arg1: A pointer to the #IndicatorObjectEntry that
@@ -169,6 +169,26 @@
169 _indicator_object_marshal_VOID__POINTER_UINT_ENUM,169 _indicator_object_marshal_VOID__POINTER_UINT_ENUM,
170 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT,170 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT,
171 INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION);171 INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION);
172 /**
173 IndicatorObject::secondary-activate:
174 @arg0: The #IndicatorObject object
175 @arg1: A pointer to the #IndicatorObjectEntry that
176 receives the secondary activate event.
177 @arg2: The timestamp of the event
178 @arg3: The X position of the pointer
179 @arg4: The Y position of the pointer
180
181 When the indicator receives a secondary activation event
182 from the user, this signal is emitted.
183 */
184 signals[SECONDARY_ACTIVATE] = g_signal_new (INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE,
185 G_TYPE_FROM_CLASS(klass),
186 G_SIGNAL_RUN_LAST,
187 G_STRUCT_OFFSET (IndicatorObjectClass, secondary_activate),
188 NULL, NULL,
189 _indicator_object_marshal_VOID__POINTER_UINT_INT_INT,
190 G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_UINT,
191 G_TYPE_INT, G_TYPE_INT);
172192
173 /**193 /**
174 IndicatorObject::menu-show:194 IndicatorObject::menu-show:
175195
=== modified file 'libindicator/indicator-object.h'
--- libindicator/indicator-object.h 2011-07-05 21:15:14 +0000
+++ libindicator/indicator-object.h 2011-07-19 15:05:07 +0000
@@ -57,6 +57,8 @@
57#define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED, INDICATOR_OBJECT_TYPE))57#define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED, INDICATOR_OBJECT_TYPE))
58#define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE "accessible-desc-update"58#define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE "accessible-desc-update"
59#define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, INDICATOR_OBJECT_TYPE))59#define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, INDICATOR_OBJECT_TYPE))
60#define INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE "secondary-activate"
61#define INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE, INDICATOR_OBJECT_TYPE))
6062
61typedef struct _IndicatorObject IndicatorObject;63typedef struct _IndicatorObject IndicatorObject;
62typedef struct _IndicatorObjectClass IndicatorObjectClass;64typedef struct _IndicatorObjectClass IndicatorObjectClass;
@@ -99,6 +101,7 @@
99 @entry_scrolled: Slot for #IndicatorObject::entry-scrolled101 @entry_scrolled: Slot for #IndicatorObject::entry-scrolled
100 @show_now_changed: Slot for #IndicatorObject::show-now-changed102 @show_now_changed: Slot for #IndicatorObject::show-now-changed
101 @accessible_desc_update: Slot for #IndicatorObject::accessible-desc-update103 @accessible_desc_update: Slot for #IndicatorObject::accessible-desc-update
104 @secondary_activate: Slot for #IndicatorObject::secondary-activate
102*/105*/
103struct _IndicatorObjectClass {106struct _IndicatorObjectClass {
104 GObjectClass parent_class;107 GObjectClass parent_class;
@@ -125,6 +128,7 @@
125 void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);128 void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
126 void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data);129 void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data);
127 void (*accessible_desc_update) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);130 void (*accessible_desc_update) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);
131 void (*secondary_activate) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gint x, gint y, gpointer user_data);
128132
129 /* Reserved */133 /* Reserved */
130 void (*reserved1) (void);134 void (*reserved1) (void);
@@ -132,7 +136,6 @@
132 void (*reserved3) (void);136 void (*reserved3) (void);
133 void (*reserved4) (void);137 void (*reserved4) (void);
134 void (*reserved5) (void);138 void (*reserved5) (void);
135 void (*reserved6) (void);
136};139};
137140
138/**141/**

Subscribers

People subscribed via source and target branches