macos: only invalidate tiles when size changes
authorChristian Hergert <christian@hergert.me>
Tue, 22 Feb 2022 08:51:53 +0000 (00:51 -0800)
committerChristian Hergert <christian@hergert.me>
Tue, 22 Feb 2022 20:01:29 +0000 (12:01 -0800)
If the size changes, we need to relayout the tiles. Otherwise we can keep
using what we had before. Generally, that shouldn't happen, but the
previous check was failing in a number of ways.

gdk/macos/GdkMacosLayer.c

index 4b723566d084b2ceabb5bb45140fe35b84ed4983..4de47a56587779d1c8475c886d13e140ed157077 100644 (file)
@@ -317,13 +317,14 @@ fromCGRect (const CGRect rect)
 
 -(void)setFrame:(NSRect)frame
 {
-  if (CGRectEqualToRect (frame, self.frame))
-    return;
-
-  self->_layoutInvalid = TRUE;
+  if (frame.size.width != self.bounds.size.width ||
+      frame.size.height != self.bounds.size.height)
+    {
+      self->_layoutInvalid = TRUE;
+      [self setNeedsLayout];
+    }
 
   [super setFrame:frame];
-  [self setNeedsLayout];
 }
 
 -(void)setOpaqueRegion:(const cairo_region_t *)opaqueRegion