From f63fc91b0ebc9fc91a0b79b0a5c8c3cde3592e28 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 5 Mar 2023 10:18:56 -0800 Subject: [PATCH] wayland/dragsurface: Get current size with compute-size signal GdkDragSurface-backed widgets are not parented to an existing widget, unlike popovers, and like toplevels. This means that there's nobody to actively call gdk_drag_surface_present() to update the size, and GdkDragSurface should do it on its own, just like GdkToplevel. This commit implements this for the Wayland backend. --- gdk/wayland/gdkdragsurface-wayland.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdk/wayland/gdkdragsurface-wayland.c b/gdk/wayland/gdkdragsurface-wayland.c index fb42488970..22220a49e4 100644 --- a/gdk/wayland/gdkdragsurface-wayland.c +++ b/gdk/wayland/gdkdragsurface-wayland.c @@ -33,6 +33,7 @@ #include "gdksurfaceprivate.h" #include "gdktoplevelprivate.h" #include "gdkdevice-wayland-private.h" +#include "gdkdragsurfacesizeprivate.h" #include #include @@ -78,6 +79,17 @@ gdk_wayland_drag_surface_compute_size (GdkSurface *surface) if (impl->next_layout.surface_geometry_dirty) { + GdkDragSurfaceSize size; + + gdk_drag_surface_size_init (&size); + size.width = impl->next_layout.configured_width; + size.height = impl->next_layout.configured_height; + + gdk_drag_surface_notify_compute_size (GDK_DRAG_SURFACE (surface), &size); + + impl->next_layout.configured_width = size.width; + impl->next_layout.configured_height = size.height; + gdk_wayland_surface_update_size (surface, impl->next_layout.configured_width, impl->next_layout.configured_height, -- 2.30.2