From 2bb19db591c96af488d90ec184ea458230a2c471 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Jan 2012 15:01:01 +0100 Subject: Adding an activate window function, that can also be virtual! --- libindicator/indicator-object.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index bd056f0..7cb75ae 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -538,6 +538,14 @@ indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entr return FALSE; } +void +indicator_object_entry_activate_window (IndicatorObject * io, IndicatorObjectEntry * entry, guint windowid, guint timestamp) +{ + + + return; +} + /** indicator_object_entry_activate: @io: #IndicatorObject to query -- cgit v1.2.3 From a6ed65aead78749086a67f92f53252b82c1bfc3d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Jan 2012 15:07:18 +0100 Subject: Documenting what this stuff does --- libindicator/indicator-object.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 7cb75ae..e606077 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -538,6 +538,22 @@ indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entr return FALSE; } +/** + indicator_object_entry_activate_window: + @io: #IndicatorObject to query + @entry: The #IndicatorObjectEntry whose entry was shown + @windowid: ID of the window that is currently focused (or will + be very shortly) + @timestamp: The X11 timestamp of the event + + Used to signal to the indicator that the menu on an entry has + been clicked on. This can either be an activate or a showing + of the menu. Also includes a window ID so that we can know what + application is going to be getting focused soon. If there is + no override of this function, it is the same as calling + indicator_object_entry_activate and in general is preferable + if you have that information available. +*/ void indicator_object_entry_activate_window (IndicatorObject * io, IndicatorObjectEntry * entry, guint windowid, guint timestamp) { -- cgit v1.2.3 From a88097a93dcbd513d2d03d699c396e7b99ed4494 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Jan 2012 15:25:42 +0100 Subject: Handling the activate_window function and going up the stack --- libindicator/indicator-object.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index e606077..1fad637 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -557,7 +557,14 @@ indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entr void indicator_object_entry_activate_window (IndicatorObject * io, IndicatorObjectEntry * entry, guint windowid, guint timestamp) { + g_return_if_fail(INDICATOR_IS_OBJECT(io)); + IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); + if (class->entry_activate_window != NULL) { + return class->entry_activate_window(io, entry, windowid, timestamp); + } else { + indicator_object_entry_activate(io, entry, timestamp); + } return; } -- cgit v1.2.3 From 0419bac431d9820e3e611aeb2d95f3a6d2caf258 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Jan 2012 15:34:48 +0100 Subject: Clearing the entry function pointers --- libindicator/indicator-object.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 1fad637..7a3e393 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -99,6 +99,10 @@ indicator_object_class_init (IndicatorObjectClass *klass) klass->get_entries = get_entries_default; klass->get_location = NULL; + klass->entry_activate = NULL; + klass->entry_activate_window = NULL; + klass->entry_close = NULL; + /** IndicatorObject::entry-added: @arg0: The #IndicatorObject object -- cgit v1.2.3