summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-04-30 15:49:06 +0800
committerPo Lu <luangruo@yahoo.com>2022-04-30 15:52:12 +0800
commit1321b5989c9a8046ce40b8edf23e3e471d2b334a (patch)
treedcbb39190bdaedb41a956caedda949020773d11c /src/w32fns.c
parent1648791e7c828ce8ced69976e4d88430bf284cf8 (diff)
downloademacs-1321b5989c9a8046ce40b8edf23e3e471d2b334a.tar.gz
emacs-1321b5989c9a8046ce40b8edf23e3e471d2b334a.tar.bz2
emacs-1321b5989c9a8046ce40b8edf23e3e471d2b334a.zip
Adjustments to double buffering on MS Windows
* src/w32fns.c (w32_set_inhibit_double_buffering): Add comment describing double buffering. (w32_wnd_proc): Respect `w32-disable-double-buffering'. (globals_of_w32fns): New variable `w32-disable-double-buffering'. * src/w32term.c (w32_show_back_buffer): Return immediately if double buffering is disabled on the frame. (w32_scroll_run): Use old scrolling code if `w32-disable-double-buffering' is enabled. (w32_scroll_bar_clear): Document why we don't clear scroll bars when double buffering is enabled. (w32_read_socket): Respect `w32-disable-double-buffering' and clean up some code. * src/w32xfns.c (get_frame_dc): Respect `w32-disable-double-buffering'.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index d4e4b2a30bf..fb71fecd95a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1802,9 +1802,16 @@ w32_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
w32_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
}
+/* Enable or disable double buffering on F.
+
+ When double buffering is enabled, all drawing happens on a back
+ buffer (a bitmap), which is then displayed as a single operation
+ after redisplay is complete. This avoids flicker caused by the
+ results of an incomplete redisplay becoming visible. */
static void
w32_set_inhibit_double_buffering (struct frame *f,
Lisp_Object new_value,
+ /* This parameter is unused. */
Lisp_Object old_value)
{
block_input ();
@@ -4114,7 +4121,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
f = w32_window_to_frame (dpyinfo, hwnd);
enter_crit ();
- if (f && !FRAME_OUTPUT_DATA (f)->paint_buffer)
+ if (f && (w32_disable_double_buffering
+ || !FRAME_OUTPUT_DATA (f)->paint_buffer))
{
HDC hdc = get_frame_dc (f);
GetUpdateRect (hwnd, &wmsg.rect, FALSE);
@@ -11236,6 +11244,12 @@ see `w32-ansi-code-page'. */);
w32_multibyte_code_page = _getmbcp ();
#endif
+ DEFVAR_BOOL ("w32-disable-double-buffering", w32_disable_double_buffering,
+ doc: /* Completely disable double buffering.
+This variable is used for debugging, and takes precedence over any
+value of the `inhibit-double-buffering' frame parameter. */);
+ w32_disable_double_buffering = false;
+
if (os_subtype == OS_SUBTYPE_NT)
w32_unicode_gui = 1;
else