From: Po Lu Date: Wed, 30 Mar 2022 00:57:23 +0000 (+0800) Subject: Add some optimizations to ShapeNotify handling X-Git-Tag: emacs-29.0.90~1931^2~867 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c52b58d2903e3ff212dc1b9e9316ee26fae5aa66;p=emacs.git Add some optimizations to ShapeNotify handling * src/xterm.c (handle_one_xevent): Do bounding rect optimizations on ShapeNotify events as well. --- diff --git a/src/xterm.c b/src/xterm.c index 28311f94e96..a92c34396ca 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -15987,6 +15987,20 @@ handle_one_xevent (struct x_display_info *dpyinfo, tem->n_input_rects = -1; } + /* And the common case where there is no input rect and the + bouding rect equals the window dimensions. */ + + if (tem->n_input_rects == -1 + && tem->n_bounding_rects == 1 + && tem->bounding_rects[0].width == tem->width + && tem->bounding_rects[0].height == tem->height + && tem->bounding_rects[0].x == -tem->border_width + && tem->bounding_rects[0].y == -tem->border_width) + { + xfree (tem->bounding_rects); + tem->n_bounding_rects = -1; + } + break; } }