[MetaWindow] Make user-time a GObject property
Notification of changes are useful for code ordering windows.
This commit is contained in:
parent
326110e38d
commit
84dc1c1b85
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user