with virtual desktops.
@vindex shaded@r{, a frame parameter}
-@item sticky
+@item shaded
If non-@code{nil}, tell the window manager to display the frame in a
way that its contents are hidden, leaving only the title bar.
+@vindex use-frame-synchronization@r{, a frame parameter}
+@item use-frame-synchronization
+If non-@code{nil}, synchronize the frame redisplay with the refresh
+rate of the monitor to avoid graphics tearing. At present, this is
+only implemented on the X window system inside no-toolkit and X
+toolkit builds, does not work correctly with toolkit scroll bars, and
+requires a compositing manager supporting the relevant display
+synchronization protocols. The @code{synchronizeResize} X resource
+must also be set to the string @code{"extended"}.
+
@vindex inhibit-double-buffering@r{, a frame parameter}
@item inhibit-double-buffering
If non-@code{nil}, the frame is drawn to the screen without double
synchronization protocol (see
https://fishsoup.net/misc/wm-spec-synchronization.html).
+This behavior can be toggled on and off via the frame parameter
+'use-frame-synchronization'.
+
+++
** New frame parameter 'alpha-background' and X resource "alphaBackground".
This controls the opacity of the text background when running on a
{"z-group", SYMBOL_INDEX (Qz_group)},
{"override-redirect", SYMBOL_INDEX (Qoverride_redirect)},
{"no-special-glyphs", SYMBOL_INDEX (Qno_special_glyphs)},
- {"alpha-background", SYMBOL_INDEX (Qalpha_background)},
+ {"alpha-background", SYMBOL_INDEX (Qalpha_background)},
+ {"use-frame-synchronization", SYMBOL_INDEX (Quse_frame_synchronization)},
#ifdef HAVE_X_WINDOWS
- {"shaded", SYMBOL_INDEX (Qshaded)},
+ {"shaded", SYMBOL_INDEX (Qshaded)},
#endif
#ifdef NS_IMPL_COCOA
{"ns-appearance", SYMBOL_INDEX (Qns_appearance)},
DEFSYM (Qtop_only, "top-only");
DEFSYM (Qiconify_top_level, "iconify-top-level");
DEFSYM (Qmake_invisible, "make-invisible");
+ DEFSYM (Quse_frame_synchronization, "use-frame-synchronization");
{
int i;
haiku_set_override_redirect,
gui_set_no_special_glyphs,
gui_set_alpha_background,
+ NULL,
};
void
0, /* x_set_override_redirect */
gui_set_no_special_glyphs,
gui_set_alpha_background,
+ NULL,
#ifdef NS_IMPL_COCOA
ns_set_appearance,
ns_set_transparent_titlebar,
pgtk_set_override_redirect,
gui_set_no_special_glyphs,
pgtk_set_alpha_background,
+ NULL,
};
0, /* x_set_override_redirect */
gui_set_no_special_glyphs,
gui_set_alpha_background,
+ 0, /* x_set_use_frame_synchronization */
};
void
}
}
+static void
+x_set_use_frame_synchronization (struct frame *f, Lisp_Object arg,
+ Lisp_Object oldval)
+{
+#if !defined USE_GTK && defined HAVE_XSYNC
+ struct x_display_info *dpyinfo;
+
+ 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);
+ else
+ FRAME_X_OUTPUT (f)->use_vsync_p = false;
+
+ store_frame_param (f, Quse_frame_synchronization,
+ FRAME_X_OUTPUT (f)->use_vsync_p ? Qt : Qnil);
+#else
+ store_frame_param (f, Quse_frame_synchronization, Qnil);
+#endif
+}
+
\f
/* Record in frame F the specified or default value according to ALIST
of the parameter named PROP (a Lisp symbol). If no value is
((STRINGP (value)
&& !strcmp (SSDATA (value), "extended")) ? 2 : 1));
#endif
-
-#ifndef USE_GTK
- if (FRAME_X_EXTENDED_COUNTER (f))
- FRAME_X_OUTPUT (f)->use_vsync_p
- = x_wm_supports (f, dpyinfo->Xatom_net_wm_frame_drawn);
-#endif
}
#endif
unblock_input ();
+ /* Set whether or not frame synchronization is enabled. */
+ gui_default_parameter (f, parms, Quse_frame_synchronization, Qt,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+
/* Works iff frame has been already mapped. */
gui_default_parameter (f, parms, Qskip_taskbar, Qnil,
NULL, NULL, RES_TYPE_BOOLEAN);
x_set_override_redirect,
gui_set_no_special_glyphs,
x_set_alpha_background,
+ x_set_use_frame_synchronization,
x_set_shaded,
};
fprintf (stderr, "Warning: compositing manager spent more than 1 second "
"drawing a frame. Frame synchronization has been disabled\n");
FRAME_X_OUTPUT (f)->use_vsync_p = false;
+
+ /* Also change the frame parameter to reflect the new state. */
+ store_frame_param (f, Quse_frame_synchronization, Qnil);
}
FRAME_X_WAITING_FOR_DRAW (f) = false;