{
XEvent event;
- if (!FRAME_X_WAITING_FOR_DRAW (f))
+ if (!FRAME_X_WAITING_FOR_DRAW (f)
+ /* The compositing manager can't draw a frame if it is
+ unmapped. */
+ || !FRAME_VISIBLE_P (f))
return;
/* Wait for the frame drawn message to arrive. */
value = FRAME_X_COUNTER_VALUE (f);
+ if (FRAME_X_OUTPUT (f)->ext_sync_end_pending_p)
+ {
+ FRAME_X_COUNTER_VALUE (f)
+ = FRAME_X_OUTPUT (f)->resize_counter_value;
+
+ value = FRAME_X_COUNTER_VALUE (f);
+
+ if (XSyncValueLow32 (value) % 2)
+ {
+ XSyncIntToValue (&add, 1);
+ XSyncValueAdd (&value, value, add, &overflow);
+
+ if (overflow)
+ XSyncIntToValue (&value, 0);
+ }
+
+ FRAME_X_OUTPUT (f)->ext_sync_end_pending_p = false;
+ }
+
/* Since a frame is already in progress, there is no point in
continuing. */
if (XSyncValueLow32 (value) % 2)
if (FRAME_X_EXTENDED_COUNTER (f) == None)
return;
- if (FRAME_X_OUTPUT (f)->ext_sync_end_pending_p)
- return;
-
value = FRAME_X_COUNTER_VALUE (f);
if (!(XSyncValueLow32 (value) % 2))
}
}
+#ifdef HAVE_XDBE
+
/* Show the frame back buffer. If frame is double-buffered,
atomically publish to the user's screen graphics updates made since
the last call to show_back_buffer. */
-#ifdef HAVE_XDBE
static void
show_back_buffer (struct frame *f)
{
unblock_input ();
}
+
#endif
/* Updates back buffer and flushes changes to display. Called from
static void
XTframe_up_to_date (struct frame *f)
{
-#if defined HAVE_XSYNC && !defined HAVE_GTK3
- XSyncValue add;
- XSyncValue current;
- Bool overflow_p;
-#elif defined HAVE_XSYNC
+#if defined HAVE_XSYNC && defined HAVE_GTK3
GtkWidget *widget;
GdkWindow *window;
GdkFrameClock *clock;
FRAME_X_OUTPUT (f)->pending_basic_counter_value);
FRAME_X_OUTPUT (f)->sync_end_pending_p = false;
}
-
- if (FRAME_X_OUTPUT (f)->ext_sync_end_pending_p
- && FRAME_X_EXTENDED_COUNTER (f) != None)
- {
- current = FRAME_X_COUNTER_VALUE (f);
-
- if (XSyncValueLow32 (current) % 2)
- XSyncIntToValue (&add, 1);
- else
- XSyncIntToValue (&add, 2);
-
- XSyncValueAdd (&FRAME_X_COUNTER_VALUE (f),
- current, add, &overflow_p);
-
- if (overflow_p)
- emacs_abort ();
-
- XSyncSetCounter (FRAME_X_DISPLAY (f),
- FRAME_X_EXTENDED_COUNTER (f),
- FRAME_X_COUNTER_VALUE (f));
-
- FRAME_X_OUTPUT (f)->ext_sync_end_pending_p = false;
-
-#ifndef USE_GTK
- if (FRAME_OUTPUT_DATA (f)->use_vsync_p)
- FRAME_X_WAITING_FOR_DRAW (f) = true;
-#endif
- }
#else
if (FRAME_X_OUTPUT (f)->xg_sync_end_pending_p)
{
}
else if (event->xclient.data.l[4] == 1)
{
- XSyncIntsToValue (&FRAME_X_COUNTER_VALUE (f),
+ XSyncIntsToValue (&FRAME_X_OUTPUT (f)->resize_counter_value,
event->xclient.data.l[2],
event->xclient.data.l[3]);