which can happen if the clock goes backwards, we erase the last
specified user_time */
if (t && event_last_user_time && event_time_after(event_last_user_time, t))
- event_last_user_time = CurrentTime;
+ event_reset_user_time();
event_sourcetime = CurrentTime;
event_curtime = t;
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_ACTIVE_WINDOW message for window %s is "
"missing source indication", client->title);
- client_activate(client, FALSE, FALSE, TRUE, TRUE,
- (e->xclient.data.l[0] == 0 ||
- e->xclient.data.l[0] == 2));
+ /* TODO(danakj) This should use
+ (e->xclient.data.l[0] == 0 ||
+ e->xclient.data.l[0] == 2)
+ to determine if a user requested the activation, however GTK+
+ applications seem unable to make this distinction ever
+ (including panels such as xfce4-panel and gnome-panel).
+ So we are left just assuming all activations are from the user.
+ */
+ client_activate(client, FALSE, FALSE, TRUE, TRUE, TRUE);
} else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) {
ob_debug("net_wm_moveresize for 0x%lx direction %d",
client->window, e->xclient.data.l[2]);
client->shaped = ((XShapeEvent*)e)->shaped;
kind = ShapeBounding;
break;
+#ifdef ShapeInput
case ShapeInput:
client->shaped_input = ((XShapeEvent*)e)->shaped;
kind = ShapeInput;
break;
+#endif
default:
g_assert_not_reached();
}
gboolean find_timestamp(XEvent *e, gpointer data)
{
const Time t = event_get_timestamp(e);
- if (t >= event_curtime) {
+ if (t && t >= event_curtime) {
event_curtime = t;
return TRUE;
}
{
event_last_user_time = event_time();
}
+
+void event_reset_user_time(void)
+{
+ event_last_user_time = CurrentTime;
+}