From c52b58d2903e3ff212dc1b9e9316ee26fae5aa66 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 30 Mar 2022 08:57:23 +0800 Subject: [PATCH] Add some optimizations to ShapeNotify handling * src/xterm.c (handle_one_xevent): Do bounding rect optimizations on ShapeNotify events as well. --- src/xterm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; } } -- 2.39.5