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
1=== modified file 'libindicator/indicator-object-marshal.list'
2--- libindicator/indicator-object-marshal.list 2011-07-02 02:13:05 +0000
3+++ libindicator/indicator-object-marshal.list 2011-07-19 15:05:07 +0000
4@@ -2,3 +2,4 @@
5 VOID: POINTER, UINT, ENUM
6 VOID: POINTER, UINT
7 VOID: POINTER, BOOLEAN
8+VOID: POINTER, UINT, INT, INT
9
10=== modified file 'libindicator/indicator-object.c'
11--- libindicator/indicator-object.c 2011-07-08 00:39:59 +0000
12+++ libindicator/indicator-object.c 2011-07-19 15:05:07 +0000
13@@ -63,6 +63,7 @@
14 MENU_SHOW,
15 SHOW_NOW_CHANGED,
16 ACCESSIBLE_DESC_UPDATE,
17+ SECONDARY_ACTIVATE,
18 LAST_SIGNAL
19 };
20
21@@ -149,8 +150,7 @@
22 NULL, NULL,
23 _indicator_object_marshal_VOID__POINTER_UINT_UINT,
24 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_NONE);
25-
26-/**
27+ /**
28 IndicatorObject::entry-scrolled:
29 @arg0: The #IndicatorObject object
30 @arg1: A pointer to the #IndicatorObjectEntry that
31@@ -169,6 +169,26 @@
32 _indicator_object_marshal_VOID__POINTER_UINT_ENUM,
33 G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_UINT,
34 INDICATOR_OBJECT_TYPE_SCROLL_DIRECTION);
35+ /**
36+ IndicatorObject::secondary-activate:
37+ @arg0: The #IndicatorObject object
38+ @arg1: A pointer to the #IndicatorObjectEntry that
39+ receives the secondary activate event.
40+ @arg2: The timestamp of the event
41+ @arg3: The X position of the pointer
42+ @arg4: The Y position of the pointer
43+
44+ When the indicator receives a secondary activation event
45+ from the user, this signal is emitted.
46+ */
47+ signals[SECONDARY_ACTIVATE] = g_signal_new (INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE,
48+ G_TYPE_FROM_CLASS(klass),
49+ G_SIGNAL_RUN_LAST,
50+ G_STRUCT_OFFSET (IndicatorObjectClass, secondary_activate),
51+ NULL, NULL,
52+ _indicator_object_marshal_VOID__POINTER_UINT_INT_INT,
53+ G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_UINT,
54+ G_TYPE_INT, G_TYPE_INT);
55
56 /**
57 IndicatorObject::menu-show:
58
59=== modified file 'libindicator/indicator-object.h'
60--- libindicator/indicator-object.h 2011-07-05 21:15:14 +0000
61+++ libindicator/indicator-object.h 2011-07-19 15:05:07 +0000
62@@ -57,6 +57,8 @@
63 #define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED, INDICATOR_OBJECT_TYPE))
64 #define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE "accessible-desc-update"
65 #define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, INDICATOR_OBJECT_TYPE))
66+#define INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE "secondary-activate"
67+#define INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE, INDICATOR_OBJECT_TYPE))
68
69 typedef struct _IndicatorObject IndicatorObject;
70 typedef struct _IndicatorObjectClass IndicatorObjectClass;
71@@ -99,6 +101,7 @@
72 @entry_scrolled: Slot for #IndicatorObject::entry-scrolled
73 @show_now_changed: Slot for #IndicatorObject::show-now-changed
74 @accessible_desc_update: Slot for #IndicatorObject::accessible-desc-update
75+ @secondary_activate: Slot for #IndicatorObject::secondary-activate
76 */
77 struct _IndicatorObjectClass {
78 GObjectClass parent_class;
79@@ -125,6 +128,7 @@
80 void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
81 void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data);
82 void (*accessible_desc_update) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);
83+ void (*secondary_activate) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gint x, gint y, gpointer user_data);
84
85 /* Reserved */
86 void (*reserved1) (void);
87@@ -132,7 +136,6 @@
88 void (*reserved3) (void);
89 void (*reserved4) (void);
90 void (*reserved5) (void);
91- void (*reserved6) (void);
92 };
93
94 /**

Subscribers

People subscribed via source and target branches