[gtk/matthiasc/surface-state-rework: 14/80] gdk/surface: Use helper to emit 'size-changed' signal




commit 59157a61c06d02d527d9d4a2a42dd90b7a14c41b
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Nov 24 16:02:23 2020 +0100

    gdk/surface: Use helper to emit 'size-changed' signal

 gdk/gdksurface.c        | 12 ++++++++++--
 gdk/gdksurfaceprivate.h |  4 ++++
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index b0831bcc55..d1e6192e53 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1277,6 +1277,14 @@ gdk_surface_schedule_update (GdkSurface *surface)
                                    GDK_FRAME_CLOCK_PHASE_PAINT);
 }
 
+void
+gdk_surface_emit_size_changed (GdkSurface *surface,
+                               int         width,
+                               int         height)
+{
+  g_signal_emit (surface, signals[SIZE_CHANGED], 0, width, height);
+}
+
 static void
 gdk_surface_process_updates_internal (GdkSurface *surface)
 {
@@ -2839,8 +2847,8 @@ gdk_surface_handle_event (GdkEvent *event)
       int width, height;
 
       gdk_configure_event_get_size (event, &width, &height);
-      g_signal_emit (gdk_event_get_surface (event), signals[SIZE_CHANGED], 0,
-                     width, height);
+      gdk_surface_emit_size_changed (gdk_event_get_surface (event),
+                                     width, height);
       handled = TRUE;
     }
   else
diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h
index 5bc290493f..5f5c3c178d 100644
--- a/gdk/gdksurfaceprivate.h
+++ b/gdk/gdksurfaceprivate.h
@@ -333,6 +333,10 @@ void       gdk_surface_queue_state_change  (GdkSurface       *surface,
 
 void       gdk_surface_apply_state_change  (GdkSurface       *surface);
 
+void       gdk_surface_emit_size_changed   (GdkSurface       *surface,
+                                            int               width,
+                                            int               height);
+
 GDK_AVAILABLE_IN_ALL
 void           gdk_surface_request_motion (GdkSurface *surface);
 


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