From c6892d03c3b5a61b335fe06d2ff570a1eb70d4d7 Mon Sep 17 00:00:00 2001 From: Colin Kinloch Date: Sat, 19 Mar 2022 19:04:12 +0000 Subject: [PATCH] (Wayland) Fix splash screen when using xdg_toplevel --- gfx/drivers_context/wayland_ctx.c | 9 +++------ gfx/drivers_context/wayland_vk_ctx.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index 35aa1b5f31..38b01d3703 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -90,12 +90,9 @@ static void handle_toplevel_config_common(void *data, break; } } - if ( width > 0 - && height > 0) - { - wl->width = width; - wl->height = height; - } + + wl->width = width > 0 ? width : DEFAULT_WINDOWED_WIDTH; + wl->height = height > 0 ? height : DEFAULT_WINDOWED_HEIGHT; #ifdef HAVE_EGL if (wl->win) diff --git a/gfx/drivers_context/wayland_vk_ctx.c b/gfx/drivers_context/wayland_vk_ctx.c index fd68f6073c..1f2167f28b 100644 --- a/gfx/drivers_context/wayland_vk_ctx.c +++ b/gfx/drivers_context/wayland_vk_ctx.c @@ -83,12 +83,9 @@ static void handle_toplevel_config_common(void *data, break; } } - if ( width > 0 - && height > 0) - { - wl->width = width; - wl->height = height; - } + + wl->width = width > 0 ? width : DEFAULT_WINDOWED_WIDTH; + wl->height = height > 0 ? height : DEFAULT_WINDOWED_HEIGHT; wl->configured = false; }