diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c index 6d072359ac..097b53facf 100644 --- a/gdk/broadway/gdksurface-broadway.c +++ b/gdk/broadway/gdksurface-broadway.c @@ -424,6 +424,14 @@ gdk_broadway_surface_move_resize (GdkSurface *surface, } } +static void +gdk_broadway_surface_toplevel_resize (GdkSurface *surface, + gint width, + gint height) +{ + gdk_broadway_surface_move_resize (surface, FALSE, 0, 0, width, height); +} + static void gdk_broadway_surface_raise (GdkSurface *surface) { @@ -1312,6 +1320,7 @@ gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *klass) impl_class->lower = gdk_broadway_surface_lower; impl_class->restack_toplevel = gdk_broadway_surface_restack_toplevel; impl_class->move_resize = gdk_broadway_surface_move_resize; + impl_class->toplevel_resize = gdk_broadway_surface_toplevel_resize; impl_class->get_geometry = gdk_broadway_surface_get_geometry; impl_class->get_root_coords = gdk_broadway_surface_get_root_coords; impl_class->get_device_state = gdk_broadway_surface_get_device_state; diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 07bd67d57f..6a29aa6ddf 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -2142,7 +2142,7 @@ gdk_surface_resize (GdkSurface *surface, gint width, gint height) { - gdk_surface_move_resize_internal (surface, FALSE, 0, 0, width, height); + GDK_SURFACE_GET_CLASS (surface)->toplevel_resize (surface, width, height); } diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h index 5f86e3c60a..eb7702f09b 100644 --- a/gdk/gdksurfaceprivate.h +++ b/gdk/gdksurfaceprivate.h @@ -119,6 +119,9 @@ struct _GdkSurfaceClass gint y, gint width, gint height); + void (* toplevel_resize) (GdkSurface *surface, + gint width, + gint height); void (* move_to_rect) (GdkSurface *surface, const GdkRectangle *rect, GdkGravity rect_anchor, diff --git a/gdk/quartz/gdksurface-quartz.c b/gdk/quartz/gdksurface-quartz.c index cf0cd15dd9..f77dc3f9bd 100644 --- a/gdk/quartz/gdksurface-quartz.c +++ b/gdk/quartz/gdksurface-quartz.c @@ -1255,6 +1255,14 @@ gdk_surface_quartz_move_resize (GdkSurface *window, } } +static void +gdk_surface_quartz_toplevel_resize (GdkSurface *surface, + gint width, + gint height) +{ + window_quartz_resize (window, width, height); +} + /* Get the toplevel ordering from NSApp and update our own list. We do * this on demand since the NSApp’s list is not up to date directly * after we get windowDidBecomeMain. @@ -2642,6 +2650,7 @@ gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass) impl_class->lower = gdk_surface_quartz_lower; impl_class->restack_toplevel = gdk_surface_quartz_restack_toplevel; impl_class->move_resize = gdk_surface_quartz_move_resize; + impl_class->toplevel_resize = gdk_surface_quartz_toplevel_resize; impl_class->get_geometry = gdk_surface_quartz_get_geometry; impl_class->get_root_coords = gdk_surface_quartz_get_root_coords; impl_class->get_device_state = gdk_surface_quartz_get_device_state; diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index ab7565a523..d9e63c3453 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -2734,6 +2734,18 @@ gdk_wayland_surface_move_resize (GdkSurface *surface, gdk_wayland_surface_maybe_resize (surface, width, height, impl->scale); } +static void +gdk_wayland_surface_toplevel_resize (GdkSurface *surface, + gint width, + gint height) +{ + GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); + + gdk_wayland_surface_maybe_resize (surface, + width, height, + impl->scale); +} + /* Avoid zero width/height as this is a protocol error */ static void sanitize_anchor_rect (GdkSurface *surface, @@ -3810,6 +3822,7 @@ gdk_wayland_surface_class_init (GdkWaylandSurfaceClass *klass) impl_class->lower = gdk_wayland_surface_lower; impl_class->restack_toplevel = gdk_wayland_surface_restack_toplevel; impl_class->move_resize = gdk_wayland_surface_move_resize; + impl_class->toplevel_resize = gdk_wayland_surface_toplevel_resize; impl_class->move_to_rect = gdk_wayland_surface_move_to_rect; impl_class->get_geometry = gdk_wayland_surface_get_geometry; impl_class->get_root_coords = gdk_wayland_surface_get_root_coords; diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index c82b397d03..720426583f 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -1262,6 +1262,14 @@ gdk_win32_surface_move_resize (GdkSurface *window, _gdk_win32_emit_configure_event (window); } +static void +gdk_win32_surface_toplevel_resize (GdkSurface *surface, + gint width, + gint height) +{ + gdk_win32_surface_move_resize (surface, FALSE, 0, 0, width, height); +} + static void gdk_win32_surface_raise (GdkSurface *window) { @@ -5083,6 +5091,7 @@ gdk_win32_surface_class_init (GdkWin32SurfaceClass *klass) impl_class->lower = gdk_win32_surface_lower; impl_class->restack_toplevel = gdk_win32_surface_restack_toplevel; impl_class->move_resize = gdk_win32_surface_move_resize; + impl_class->toplevel_resize = gdk_win32_surface_toplevel_resize; impl_class->get_geometry = gdk_win32_surface_get_geometry; impl_class->get_device_state = gdk_surface_win32_get_device_state; impl_class->get_root_coords = gdk_win32_surface_get_root_coords; diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index 654876e2b8..9859518e8b 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -1392,6 +1392,14 @@ gdk_x11_surface_move_resize (GdkSurface *surface, } } +static void +gdk_x11_surface_toplevel_resize (GdkSurface *surface, + gint width, + gint height) +{ + x11_surface_resize (surface, width, height); +} + static void gdk_x11_surface_restack_toplevel (GdkSurface *surface, GdkSurface *sibling, gboolean above); @@ -4590,6 +4598,7 @@ gdk_x11_surface_class_init (GdkX11SurfaceClass *klass) impl_class->lower = gdk_x11_surface_lower; impl_class->restack_toplevel = gdk_x11_surface_restack_toplevel; impl_class->move_resize = gdk_x11_surface_move_resize; + impl_class->toplevel_resize = gdk_x11_surface_toplevel_resize; impl_class->get_geometry = gdk_x11_surface_get_geometry; impl_class->get_root_coords = gdk_x11_surface_get_root_coords; impl_class->get_device_state = gdk_x11_surface_get_device_state;