if (!is_substructure && toplevel && display_x11->use_sync && toplevel->pending_counter_value != 0)
{
toplevel->configure_counter_value = toplevel->pending_counter_value;
+ toplevel->configure_counter_value_is_extended = toplevel->pending_counter_value_is_extended;
toplevel->pending_counter_value = 0;
}
#endif
guint32 d2 = xevent->xclient.data.l[2];
guint32 d3 = xevent->xclient.data.l[3];
- guint64 serial = ((guint64)d0 << 32) | d1;
- gint64 frame_drawn_time = ((guint64)d2 << 32) | d3;
+ guint64 serial = ((guint64)d1 << 32) | d0;
+ gint64 frame_drawn_time = ((guint64)d3 << 32) | d2;
gint64 refresh_interval, presentation_time;
GdkFrameClock *clock = gdk_window_get_frame_clock (event->any.window);
guint32 d2 = xevent->xclient.data.l[2];
guint32 d3 = xevent->xclient.data.l[3];
- guint64 serial = ((guint64)d0 << 32) | d1;
+ guint64 serial = ((guint64)d1 << 32) | d0;
GdkFrameClock *clock = gdk_window_get_frame_clock (event->any.window);
GdkFrameTimings *timings = find_frame_timings (clock, serial);
{
#ifdef HAVE_XSYNC
toplevel->pending_counter_value = xevent->xclient.data.l[2] + ((gint64)xevent->xclient.data.l[3] << 32);
+ toplevel->pending_counter_value_is_extended = xevent->xclient.data.l[4] != 0;
#endif
}
return GDK_FILTER_REMOVE;
GDK_X11_DISPLAY (display)->use_sync &&
toplevel->configure_counter_value != 0)
{
- set_sync_counter (GDK_WINDOW_XDISPLAY (window),
- toplevel->update_counter,
- toplevel->configure_counter_value);
-
- toplevel->current_counter_value = toplevel->configure_counter_value;
- if ((toplevel->current_counter_value % 2) == 1)
- toplevel->current_counter_value += 1;
+ if (toplevel->configure_counter_value_is_extended)
+ {
+ toplevel->current_counter_value = toplevel->configure_counter_value;
+ if ((toplevel->current_counter_value % 2) == 1)
+ toplevel->current_counter_value += 1;
- toplevel->configure_counter_value = 0;
+ toplevel->configure_counter_value = 0;
- set_sync_counter (GDK_WINDOW_XDISPLAY (window),
- toplevel->extended_update_counter,
- toplevel->current_counter_value);
- }
+ set_sync_counter (GDK_WINDOW_XDISPLAY (window),
+ toplevel->extended_update_counter,
+ toplevel->current_counter_value);
+ }
+ else
+ {
+ set_sync_counter (GDK_WINDOW_XDISPLAY (window),
+ toplevel->update_counter,
+ toplevel->configure_counter_value);
+ }
+ }
}
#endif
}
/* If we're expecting a response from the compositor after painting a frame */
guint frame_pending : 1;
-
+
+ /* Whether pending_counter_value/configure_counter_value are updates
+ * to the extended update counter */
+ guint pending_counter_value_is_extended : 1;
+ guint configure_counter_value_is_extended : 1;
+
gulong map_serial; /* Serial of last transition from unmapped */
cairo_surface_t *icon_pixmap;