[mutter] [MetaWindow] Make user-time a GObject property



commit 84dc1c1b8554471ff252a4075fca43fc307dcaf1
Author: Colin Walters <walters verbum org>
Date:   Mon Aug 31 12:06:53 2009 -0400

    [MetaWindow] Make user-time a GObject property
    
    Notification of changes are useful for code ordering windows.

 src/core/window.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 5f5e62b..a3997a7 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -136,7 +136,8 @@ enum {
   PROP_MINI_ICON,
   PROP_DECORATED,
   PROP_FULLSCREEN,
-  PROP_WINDOW_TYPE
+  PROP_WINDOW_TYPE,
+  PROP_USER_TIME
 };
 
 enum
@@ -202,6 +203,9 @@ meta_window_get_property(GObject         *object,
     case PROP_WINDOW_TYPE:
       g_value_set_enum (value, win->type);
       break;
+    case PROP_USER_TIME:
+      g_value_set_uint (value, win->net_wm_user_time);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -280,6 +284,16 @@ meta_window_class_init (MetaWindowClass *klass)
                                                       META_WINDOW_NORMAL,
                                                       G_PARAM_READABLE));
 
+  g_object_class_install_property (object_class,
+                                   PROP_USER_TIME,
+                                   g_param_spec_uint ("user-time",
+                                                      "User time",
+                                                      "Timestamp of last user interaction",
+                                                      0,
+                                                      G_MAXUINT,
+                                                      0,
+                                                      G_PARAM_READABLE));
+
   window_signals[WORKSPACE_CHANGED] =
     g_signal_new ("workspace-changed",
                   G_TYPE_FROM_CLASS (object_class),
@@ -8514,6 +8528,8 @@ meta_window_set_user_time (MetaWindow *window,
           __window_is_terminal (window))
         window->display->allow_terminal_deactivation = FALSE;
     }
+
+  g_object_notify (G_OBJECT (window), "user-time");
 }
 
 /* Sets the demands_attention hint on a window, but only



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