aboutsummaryrefslogtreecommitdiff
path: root/libindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-01-19 10:41:20 -0600
committerTed Gould <ted@gould.cx>2012-01-19 10:41:20 -0600
commit1cf6a9761db8beefc8d2a73c2cf9903264424c66 (patch)
tree8e358aa08f9e32aa8b6b8b9580ed615b4f99642d /libindicator
parente3ce5513c45374858d9af5ae82ff9a711b6cf2aa (diff)
parent6a0f41aaa53cb79e03520a8214cc2c9305821496 (diff)
downloadlibayatana-indicator-1cf6a9761db8beefc8d2a73c2cf9903264424c66.tar.gz
libayatana-indicator-1cf6a9761db8beefc8d2a73c2cf9903264424c66.tar.bz2
libayatana-indicator-1cf6a9761db8beefc8d2a73c2cf9903264424c66.zip
Adding a window ID function to pass the window ID
Diffstat (limited to 'libindicator')
-rw-r--r--libindicator/indicator-object.c35
-rw-r--r--libindicator/indicator-object.h2
2 files changed, 37 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index bd056f0..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
@@ -539,6 +543,37 @@ indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entr
}
/**
+ 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)
+{
+ 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;
+}
+
+/**
indicator_object_entry_activate:
@io: #IndicatorObject to query
@entry: The #IndicatorObjectEntry whose entry was shown
diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h
index 3a120f5..bbc215a 100644
--- a/libindicator/indicator-object.h
+++ b/libindicator/indicator-object.h
@@ -118,6 +118,7 @@ struct _IndicatorObjectClass {
gboolean (*get_show_now) (IndicatorObject * io, IndicatorObjectEntry * entry);
void (*entry_activate) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
+ void (*entry_activate_window) (IndicatorObject * io, IndicatorObjectEntry * entry, guint windowid, guint timestamp);
void (*entry_close) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
/* Signals */
@@ -184,6 +185,7 @@ GList * indicator_object_get_entries (IndicatorObject * io);
guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry);
guint indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entry);
void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
+void indicator_object_entry_activate_window (IndicatorObject * io, IndicatorObjectEntry * entry, guint windowid, guint timestamp);
void indicator_object_entry_close (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
void indicator_object_set_environment (IndicatorObject * io, const GStrv env);