wayland: Remove useless function
authorBenjamin Otte <otte@redhat.com>
Thu, 13 Apr 2023 00:47:51 +0000 (02:47 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 13 Apr 2023 00:48:47 +0000 (02:48 +0200)
gdk_wayland_surface_maybe_resize() just calls
gdk_wayland_surface_update_size(), so make all callers call that one
instead.

The check that it does is done by the other function again.

gdk/wayland/gdksurface-wayland.c

index 523e0eef2e41b3f7e17f952433ed7f087cc428e7..8dfd9531db2adb0d872cb268a7c06956b8acfcbc 100644 (file)
@@ -198,22 +198,6 @@ gdk_wayland_surface_thaw_state (GdkSurface *surface)
     gdk_wayland_surface_configure (surface);
 }
 
-static void
-gdk_wayland_surface_maybe_resize (GdkSurface               *surface,
-                                  int                       width,
-                                  int                       height,
-                                  const GdkFractionalScale *scale)
-{
-  GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
-
-  if (surface->width == width &&
-      surface->height == height &&
-      gdk_fractional_scale_equal (&impl->scale, scale))
-    return;
-
-  gdk_wayland_surface_update_size (surface, width, height, scale);
-}
-
 static inline void
 get_egl_window_size (GdkSurface *surface,
                      int        *width,
@@ -492,9 +476,9 @@ gdk_wayland_surface_update_scale (GdkSurface *surface)
     }
 
   /* Notify app that scale changed */
-  gdk_wayland_surface_maybe_resize (surface,
-                                    surface->width, surface->height,
-                                    &GDK_FRACTIONAL_SCALE_INIT_INT (scale));
+  gdk_wayland_surface_update_size (surface,
+                                   surface->width, surface->height,
+                                   &GDK_FRACTIONAL_SCALE_INIT_INT (scale));
 }
 
 GdkSurface *
@@ -842,9 +826,9 @@ gdk_wayland_surface_fractional_scale_preferred_scale_cb (void *data,
   GdkSurface *surface = GDK_SURFACE (self);
   
   /* Notify app that scale changed */
-  gdk_wayland_surface_maybe_resize (surface,
-                                    surface->width, surface->height,
-                                    &GDK_FRACTIONAL_SCALE_INIT (scale));
+  gdk_wayland_surface_update_size (surface,
+                                   surface->width, surface->height,
+                                   &GDK_FRACTIONAL_SCALE_INIT (scale));
 }
 
 static const struct wp_fractional_scale_v1_listener fractional_scale_listener = {
@@ -1139,7 +1123,7 @@ gdk_wayland_surface_move_resize (GdkSurface *surface,
 
   surface->x = x;
   surface->y = y;
-  gdk_wayland_surface_maybe_resize (surface, width, height, &impl->scale);
+  gdk_wayland_surface_update_size (surface, width, height, &impl->scale);
 }
 
 static void