Add public meta_window_get_user_time

Useful for sorting windows by interaction time.
This commit is contained in:
Colin Walters 2009-08-30 20:04:48 -04:00
parent 35b1dda3a3
commit 81183c71c1
2 changed files with 21 additions and 0 deletions

View File

@ -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)

View File

@ -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);