surface: reformat function
authorBenjamin Otte <otte@redhat.com>
Sat, 22 Apr 2023 14:35:16 +0000 (16:35 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 22 Apr 2023 14:35:16 +0000 (16:35 +0200)
Make the function follow usual coding conventions.

And while doing that, remove duplicate functionality.

gdk/gdksurface.c

index 34052799e8c8dd758f3c9049b1f4b35f6b6d1b53..4a3409508ed7012a22ea3545d9b287a17648060c 100644 (file)
@@ -1365,13 +1365,7 @@ gdk_surface_paint_on_clock (GdkFrameClock *clock,
       gdk_surface_is_toplevel_frozen (surface))
     return;
 
-  g_object_ref (surface);
-
   surface->pending_phases &= ~GDK_FRAME_CLOCK_PHASE_PAINT;
-
-  /* Ensure the surface lives while updating it */
-  g_object_ref (surface);
-
   expose_region = surface->update_area;
   surface->update_area = NULL;
 
@@ -1379,14 +1373,14 @@ gdk_surface_paint_on_clock (GdkFrameClock *clock,
     {
       gboolean handled;
 
+      g_object_ref (surface);
+
       g_signal_emit (surface, signals[RENDER], 0, expose_region, &handled);
+
+      g_object_unref (surface);
     }
 
   cairo_region_destroy (expose_region);
-
-  g_object_unref (surface);
-
-  g_object_unref (surface);
 }
 
 /*