[plasma/kwin] src/wayland: wayland: Use the invalid-size error for invalid window geometry
Vlad Zahorodnii <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 9ab77d7bcafe5e5bae680a137a3f581f52be3498 by Vlad Zahorodnii, on behalf of cfmc30 meow.
Committed on 21/07/2026 at 20:20.
Pushed by vladz into branch 'master'.
wayland: Use the invalid-size error for invalid window geometry
`xdg_surface.set_window_geometry` currently posts an unspecified protocol error when a client provides a non-positive width or height.
Use `xdg_surface.error_invalid_size` instead of an unspecified protocol error when a client provides a non-positive window geometry dimension.
Follow-up: [`src/wayland/plasmashell.cpp`](https://invent.kde.org/plasma/kwin/-/blob/master/src/wayland/plasmashell.cpp?ref_type=heads#L165) has similar raw protocol error codes `-1`. Determining the appropriate protocol error and behavior for those cases requires separate investigation, so it is intentionally out of scope for this MR.
M +1 -1 src/wayland/xdgshell.cpp
https://invent.kde.org/plasma/kwin/-/commit/9ab77d7bcafe5e5bae680a137a3f581f52be3498
diff --git a/src/wayland/xdgshell.cpp b/src/wayland/xdgshell.cpp
index fc84ffc7ec8..43f987afde4 100644
--- a/src/wayland/xdgshell.cpp
+++ b/src/wayland/xdgshell.cpp
@@ -258,7 +258,7 @@ void XdgSurfaceInterfacePrivate::xdg_surface_set_window_geometry(Resource *resou
}
if (width < 1 || height < 1) {
- wl_resource_post_error(resource->handle, -1, "invalid window geometry size (%dx%d)", width, height);
+ wl_resource_post_error(resource->handle, error_invalid_size, "invalid window geometry size (%dx%d)", width, height);
return;
}