[gtk/wip/chergert/quartz4u: 83/120] macos: bit of cleanup



commit ec158524d30f0ca4b00600acc4c29907bd20208a
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 20 12:57:00 2020 -0700

    macos: bit of cleanup

 gdk/macos/GdkMacosCairoView.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gdk/macos/GdkMacosCairoView.c b/gdk/macos/GdkMacosCairoView.c
index 48d763e739..70beb0cacc 100644
--- a/gdk/macos/GdkMacosCairoView.c
+++ b/gdk/macos/GdkMacosCairoView.c
@@ -55,9 +55,7 @@
 
   if (self->surface == NULL)
     {
-      NSRect rect = [self bounds];
-      rect.origin.x = rect.origin.y = 0;
-      [self setNeedsDisplayInRect:rect];
+      [self setNeedsDisplay:YES];
     }
   else
     {
@@ -70,8 +68,11 @@
         }
     }
 
-  g_clear_pointer (&self->surface, cairo_surface_destroy);
-  self->surface = cairo_surface_reference (cairoSurface);
+  if (self->surface != cairoSurface)
+    {
+      g_clear_pointer (&self->surface, cairo_surface_destroy);
+      self->surface = cairo_surface_reference (cairoSurface);
+    }
 }
 
 -(void)drawRect:(NSRect)rect


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]