[mutter] wayland/surface: Disable WL_SURFACE_ERROR_INVALID_SIZE check again



commit f9857cb8bd7af20e819283917ae165fa40c19f07
Author: Robert Mader <robert mader collabora com>
Date:   Thu Mar 10 00:19:21 2022 +0100

    wayland/surface: Disable WL_SURFACE_ERROR_INVALID_SIZE check again
    
    The check was introduces in ab17c98c947aa9a53eecf27d7242c18c5dccbbfc
    but turned out to trigger client crashes in common cases.
    Turn it into a warning for now until clients are fixed.
    
    Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/2083
    Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/2163
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2335>

 src/wayland/meta-wayland-surface.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 3bbe82456e..8deca4f29f 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -791,12 +791,16 @@ meta_wayland_surface_apply_state (MetaWaylandSurface      *surface,
   if ((get_buffer_width (surface) % surface->scale != 0) ||
       (get_buffer_height (surface) % surface->scale != 0))
     {
-      wl_resource_post_error (surface->resource, WL_SURFACE_ERROR_INVALID_SIZE,
-                              "Buffer size (%dx%d) must be an integer multiple "
-                              "of the buffer_scale (%d)",
-                              get_buffer_width (surface),
-                              get_buffer_height (surface), surface->scale);
-      goto cleanup;
+      struct wl_resource *resource = surface->resource;
+      pid_t pid;
+
+      wl_client_get_credentials (wl_resource_get_client (resource), &pid, NULL,
+                                 NULL);
+
+      g_warning ("Bug in client with pid %ld: Buffer size (%dx%d) is not an"
+                 "integer multiple of the buffer_scale (%d).", (long) pid,
+                 get_buffer_width (surface), get_buffer_height (surface),
+                 surface->scale);
     }
 
   if (state->has_new_buffer_transform)


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