-void client_update_user_time(ObClient *self)
-{
- guint32 time;
- gboolean got = FALSE;
-
- if (self->user_time_window)
- got = PROP_GET32(self->user_time_window,
- net_wm_user_time, cardinal, &time);
- if (!got)
- got = PROP_GET32(self->window, net_wm_user_time, cardinal, &time);
-
- if (got) {
- /* we set this every time, not just when it grows, because in practice
- sometimes time goes backwards! (ntpdate.. yay....) so.. if it goes
- backward we don't want all windows to stop focusing. we'll just
- assume noone is setting times older than the last one, cuz that
- would be pretty stupid anyways
- */
- self->user_time = time;
-
- /*ob_debug("window %s user time %u\n", self->title, time);*/
- }
-}
-
-void client_update_user_time_window(ObClient *self)
-{
- guint32 w;
-
- if (!PROP_GET32(self->window, net_wm_user_time_window, window, &w))
- w = None;
-
- if (w != self->user_time_window) {
- /* remove the old window */
- propwin_remove(self->user_time_window, OB_PROPWIN_USER_TIME, self);
- self->user_time_window = None;
-
- if (self->group && self->group->leader == w) {
- ob_debug_type(OB_DEBUG_APP_BUGS, "Window is setting its "
- "_NET_WM_USER_TYPE_WINDOW to its group leader\n");
- /* do it anyways..? */
- }
- else if (w == self->window) {
- ob_debug_type(OB_DEBUG_APP_BUGS, "Window is setting its "
- "_NET_WM_USER_TIME_WINDOW to itself\n");
- w = None; /* don't do it */
- }
-
- /* add the new window */
- propwin_add(w, OB_PROPWIN_USER_TIME, self);
- self->user_time_window = w;
-
- /* and update from it */
- client_update_user_time(self);
- }
-}
-