This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch wl/browser-all
in repository enlightenment.

View the commit online.

commit 34579eac922f9fc0b3d4ff22e25b43a01378b964
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Aug 8 21:58:38 2026 -0600

    wl_desktop_shell - post unconfigured_buffer on the xdg_surface
    
    E-23.
    
    _e_xdg_shell_surface_buffer_attach_error() posted the error on
    ec->comp_data->surface - the wl_surface - rather than on the xdg_surface it
    belongs to. Wrong object, and the error code collides: both
    XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER and ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER
    are 3, and wl_surface error 3 is invalid_offset.
    
    So a client that attached a buffer before its first configure was told its
    buffer *offset* was invalid - and at wl_compositor v4 a non-zero offset is
    perfectly legal, so the complaint pointed at something the client had every
    right to do. Anyone debugging from that message starts in the wrong place.
    
    The decision to reject the attach is correct and unchanged; only the
    reporting moves. Post on shd->surface, which is the xdg_surface resource
    (xdg.c:1388) - note shell.surface is the toplevel/popup, not the
    xdg_surface.
    
    Found by wlcs, which reported "protocol error 3 on interface wl_surface v4"
    and now reports it on xdg_surface / zxdg_surface_v6 where it belongs.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
 src/modules/wl_desktop_shell/xdg.c  | 18 +++++++++++++++---
 src/modules/wl_desktop_shell/xdg6.c | 18 +++++++++++++++---
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/modules/wl_desktop_shell/xdg.c b/src/modules/wl_desktop_shell/xdg.c
index 71c480955..2f36f5937 100644
--- a/src/modules/wl_desktop_shell/xdg.c
+++ b/src/modules/wl_desktop_shell/xdg.c
@@ -1338,9 +1338,21 @@ _e_xdg_shell_surface_cb_destroy(struct wl_resource *resource)
 static void
 _e_xdg_shell_surface_buffer_attach_error(E_Client *ec)
 {
-   wl_resource_post_error(ec->comp_data->surface,
-                               XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
-                               "buffer attached/committed before configure");
+   E_Shell_Data *shd = ec->comp_data->shell.data;
+
+   /* Post this on the xdg_surface, not on the wl_surface.
+    *
+    * It used to go to ec->comp_data->surface, which is wrong twice over: the
+    * error belongs to xdg_surface, and XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER == 3, which
+    * on wl_surface means invalid_offset. So a client that attached before
+    * configure was told its *buffer offset* was invalid - and at
+    * wl_compositor v4 a non-zero offset is perfectly legal, so the complaint
+    * pointed at something the client had every right to do. */
+   if (!shd || !shd->surface) return;
+
+   wl_resource_post_error(shd->surface,
+                          XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
+                          "buffer attached/committed before configure");
 }
 
 static void
diff --git a/src/modules/wl_desktop_shell/xdg6.c b/src/modules/wl_desktop_shell/xdg6.c
index e2b3f27bb..798593342 100644
--- a/src/modules/wl_desktop_shell/xdg6.c
+++ b/src/modules/wl_desktop_shell/xdg6.c
@@ -1313,9 +1313,21 @@ _e_xdg_shell_surface_cb_destroy(struct wl_resource *resource)
 static void
 _e_xdg_shell_surface_buffer_attach_error(E_Client *ec)
 {
-   wl_resource_post_error(ec->comp_data->surface,
-                               ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER,
-                               "buffer attached/committed before configure");
+   E_Shell_Data *shd = ec->comp_data->shell.data;
+
+   /* Post this on the zxdg_surface_v6, not on the wl_surface.
+    *
+    * It used to go to ec->comp_data->surface, which is wrong twice over: the
+    * error belongs to zxdg_surface_v6, and ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER == 3, which
+    * on wl_surface means invalid_offset. So a client that attached before
+    * configure was told its *buffer offset* was invalid - and at
+    * wl_compositor v4 a non-zero offset is perfectly legal, so the complaint
+    * pointed at something the client had every right to do. */
+   if (!shd || !shd->surface) return;
+
+   wl_resource_post_error(shd->surface,
+                          ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER,
+                          "buffer attached/committed before configure");
 }
 
 static void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to