From 35da5ca5a6722da426282962393de48b9ebd32fc Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 6 May 2025 15:30:37 +0300 Subject: [PATCH] xdg-client-helper: Use a default WINDOW size value If the shell doesn't provide a configure size, use a default one. Signed-off-by: Marius Vlad --- tests/xdg-client-helper.c | 13 +++++++++++-- tests/xdg-client-helper.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/xdg-client-helper.c b/tests/xdg-client-helper.c index 6523c5a40..644199b7e 100644 --- a/tests/xdg-client-helper.c +++ b/tests/xdg-client-helper.c @@ -167,8 +167,17 @@ xdg_surface_commit_solid(struct xdg_surface_data *xdg_surface, { pixman_color_t color; struct buffer *buf; - int width = xdg_surface->configure.width; - int height = xdg_surface->configure.height; + int width = 0; + int height = 0; + + if (xdg_surface->configure.width == 0 && + xdg_surface->configure.height == 0) { + xdg_surface->configure.width = + xdg_surface->configure.height = DEFAULT_WINDOW_SIZE; + } + + width = xdg_surface->configure.width; + height = xdg_surface->configure.height; buf = create_shm_buffer_a8r8g8b8(xdg_surface->surface->client, width, height); diff --git a/tests/xdg-client-helper.h b/tests/xdg-client-helper.h index 1571329a1..363830a0d 100644 --- a/tests/xdg-client-helper.h +++ b/tests/xdg-client-helper.h @@ -26,6 +26,7 @@ #ifndef __HAVE_XDG_CLIENT_HELPER_H #define __HAVE_XDG_CLIENT_HELPER_H +#define DEFAULT_WINDOW_SIZE 120 struct xdg_client { struct client *client;