From 84dc1c1b8554471ff252a4075fca43fc307dcaf1 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 31 Aug 2009 12:06:53 -0400 Subject: [PATCH] [MetaWindow] Make user-time a GObject property Notification of changes are useful for code ordering windows. --- src/core/window.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/core/window.c b/src/core/window.c index 5f5e62b78..a3997a76b 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