{
#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME
struct x_display_info *dpyinfo;
+ unsigned long bypass_compositor;
dpyinfo = FRAME_DISPLAY_INFO (f);
if (!NILP (arg) && FRAME_X_EXTENDED_COUNTER (f))
- FRAME_X_OUTPUT (f)->use_vsync_p
- = x_wm_supports (f, dpyinfo->Xatom_net_wm_frame_drawn);
+ {
+ FRAME_X_OUTPUT (f)->use_vsync_p
+ = x_wm_supports (f, dpyinfo->Xatom_net_wm_frame_drawn);
+
+ /* At the same time, write the bypass compositor property to the
+ outer window. 2 means to never bypass the compositor, as we
+ need its cooperation for frame synchronization. */
+ bypass_compositor = 2;
+ XChangeProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
+ dpyinfo->Xatom_net_wm_bypass_compositor,
+ XA_CARDINAL, 32, PropModeReplace,
+ (unsigned char *) &bypass_compositor, 1);
+ }
else
- FRAME_X_OUTPUT (f)->use_vsync_p = false;
+ {
+ FRAME_X_OUTPUT (f)->use_vsync_p = false;
+
+ /* Remove the compositor bypass property from the outer
+ window. */
+ XDeleteProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
+ dpyinfo->Xatom_net_wm_bypass_compositor);
+ }
store_frame_param (f, Quse_frame_synchronization,
FRAME_X_OUTPUT (f)->use_vsync_p ? Qt : Qnil);
ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST", Xatom_net_wm_sync_request)
ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST_COUNTER", Xatom_net_wm_sync_request_counter)
ATOM_REFS_INIT ("_NET_WM_SYNC_FENCES", Xatom_net_wm_sync_fences)
+ ATOM_REFS_INIT ("_NET_WM_BYPASS_COMPOSITOR", Xatom_net_wm_bypass_compositor)
ATOM_REFS_INIT ("_NET_WM_FRAME_DRAWN", Xatom_net_wm_frame_drawn)
ATOM_REFS_INIT ("_NET_WM_FRAME_TIMINGS", Xatom_net_wm_frame_timings)
ATOM_REFS_INIT ("_NET_WM_USER_TIME", Xatom_net_wm_user_time)
Xatom_net_wm_sync_request, Xatom_net_wm_sync_request_counter,
Xatom_net_wm_sync_fences, Xatom_net_wm_frame_drawn, Xatom_net_wm_frame_timings,
Xatom_net_wm_user_time, Xatom_net_wm_user_time_window,
- Xatom_net_client_list_stacking, Xatom_net_wm_pid;
+ Xatom_net_client_list_stacking, Xatom_net_wm_pid,
+ Xatom_net_wm_bypass_compositor;
/* XSettings atoms and windows. */
Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;