* src/xfns.c (append_wm_protocols): Don't append
_NET_WM_SYNC_REQUEST unless the display supports our version of
XSync.
* src/xterm.c (handle_one_xevent): Don't handle
_NET_WM_SYNC_REQUEST unless the display supports that.
(x_free_frame_resources): Test basic counter against None.
if (!found_wm_ping)
protos[num_protos++] = dpyinfo->Xatom_net_wm_ping;
#if !defined HAVE_GTK3 && defined HAVE_XSYNC
- if (!found_wm_sync_request)
+ if (!found_wm_sync_request && dpyinfo->xsync_supported_p)
protos[num_protos++] = dpyinfo->Xatom_net_wm_sync_request;
#endif
#if defined HAVE_XSYNC && !defined HAVE_GTK3
if (event->xclient.data.l[0] == dpyinfo->Xatom_net_wm_sync_request
- && event->xclient.format == 32)
+ && event->xclient.format == 32
+ && dpyinfo->xsync_supported_p)
{
struct frame *f
= x_top_window_to_frame (dpyinfo,
#endif /* !USE_X_TOOLKIT */
#ifdef HAVE_XSYNC
- if (FRAME_X_BASIC_COUNTER (f))
+ if (FRAME_X_BASIC_COUNTER (f) != None)
XSyncDestroyCounter (FRAME_X_DISPLAY (f),
FRAME_X_BASIC_COUNTER (f));
#endif