From: Christian Hergert Date: Tue, 22 Feb 2022 08:51:53 +0000 (-0800) Subject: macos: only invalidate tiles when size changes X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~72^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=df8e2bc0a0f24ded38f65d0b4a2aaa03e255359f;p=gtk4.git macos: only invalidate tiles when size changes 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. --- diff --git a/gdk/macos/GdkMacosLayer.c b/gdk/macos/GdkMacosLayer.c index 4b723566d0..4de47a5658 100644 --- a/gdk/macos/GdkMacosLayer.c +++ b/gdk/macos/GdkMacosLayer.c @@ -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