[mutter] Add public meta_window_get_user_time



commit 81183c71c18d7071ef62264f86993fe8d113e437
Author: Colin Walters <walters verbum org>
Date:   Sun Aug 30 20:04:48 2009 -0400

    Add public meta_window_get_user_time
    
    Useful for sorting windows by interaction time.

 src/core/window.c    |   20 ++++++++++++++++++++
 src/include/window.h |    1 +
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 9a6d755..82ced02 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8456,6 +8456,26 @@ meta_window_stack_just_below (MetaWindow *window,
     }
 }
 
+/**
+ * meta_window_get_user_time:
+ *
+ * The user time represents a timestamp for the last time the user
+ * interacted with this window.  Note this property is only available
+ * for non-override-redirect windows.
+ *
+ * The property is set by Mutter initially upon window creation,
+ * and updated thereafter on input events (key and button presses) seen by Mutter,
+ * client updates to the _NET_WM_USER_TIME property (if later than the current time)
+ * and when focusing the window.
+ *
+ * Returns: The last time the user interacted with this window.
+ */
+guint32
+meta_window_get_user_time (MetaWindow *window)
+{
+  return window->net_wm_user_time;
+}
+
 void
 meta_window_set_user_time (MetaWindow *window,
                            guint32     timestamp)
diff --git a/src/include/window.h b/src/include/window.h
index 5aaa588..7823470 100644
--- a/src/include/window.h
+++ b/src/include/window.h
@@ -118,6 +118,7 @@ const char *meta_window_get_title (MetaWindow *window);
 MetaWindow *meta_window_get_transient_for (MetaWindow *window);
 void        meta_window_delete             (MetaWindow  *window,
                                             guint32      timestamp);
+guint32     meta_window_get_user_time (MetaWindow *window);
 int         meta_window_get_pid (MetaWindow *window);
 const char *meta_window_get_client_machine (MetaWindow *window);
 gboolean    meta_window_is_modal (MetaWindow *window);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]