]> git.eshelyaron.com Git - emacs.git/commitdiff
Add some optimizations to ShapeNotify handling
authorPo Lu <luangruo@yahoo.com>
Wed, 30 Mar 2022 00:57:23 +0000 (08:57 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 30 Mar 2022 00:57:55 +0000 (08:57 +0800)
* src/xterm.c (handle_one_xevent): Do bounding rect
optimizations on ShapeNotify events as well.

src/xterm.c

index 28311f94e9618e66369390428f979864cbfa7888..a92c34396ca8e1ee09cd468aa2bbb0a56e65a125 100644 (file)
@@ -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;
                }
            }