summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-03-05 10:05:14 +0800
committerPo Lu <luangruo@yahoo.com>2022-03-05 10:05:14 +0800
commit76d79e1576956eb0c07eb830fd75f7b7c4192efe (patch)
tree2393a110b4157a1efda9f4dc2a91377de3275cf0
parent6efed75ff3158214d16482f2bcca06c9ac010da4 (diff)
downloademacs-76d79e1576956eb0c07eb830fd75f7b7c4192efe.tar.gz
emacs-76d79e1576956eb0c07eb830fd75f7b7c4192efe.tar.bz2
emacs-76d79e1576956eb0c07eb830fd75f7b7c4192efe.zip
Prevent some NoExpose events from being generated
* src/xterm.c (x_scroll_run): Use the rendering extension if available to avoid NoExpose events.
-rw-r--r--src/xterm.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 948afa56808..89ec43b4705 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6037,12 +6037,24 @@ x_scroll_run (struct window *w, struct run *run)
}
else
#endif /* USE_CAIRO */
- XCopyArea (FRAME_X_DISPLAY (f),
- FRAME_X_DRAWABLE (f), FRAME_X_DRAWABLE (f),
- f->output_data.x->normal_gc,
- x, from_y,
- width, height,
- x, to_y);
+ {
+#ifdef HAVE_XRENDER
+ /* Avoid useless NoExpose events. This way, we only get regular
+ exposure events when there is actually something to
+ expose. */
+ if (FRAME_X_PICTURE (f) != None)
+ XRenderComposite (FRAME_X_DISPLAY (f), PictOpSrc, FRAME_X_PICTURE (f),
+ None, FRAME_X_PICTURE (f), x, from_y, 0, 0, x, to_y,
+ width, height);
+ else
+#endif
+ XCopyArea (FRAME_X_DISPLAY (f),
+ FRAME_X_DRAWABLE (f), FRAME_X_DRAWABLE (f),
+ f->output_data.x->normal_gc,
+ x, from_y,
+ width, height,
+ x, to_y);
+ }
unblock_input ();
}