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 <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2025-05-06 15:30:37 +03:00
parent 7bb9fc5b62
commit 35da5ca5a6
2 changed files with 12 additions and 2 deletions

View file

@ -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);

View file

@ -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;