mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Wayland) Skip splash screen if window is not ready
This commit is contained in:
parent
27a6210f96
commit
065fb5acee
@ -616,7 +616,8 @@ static void *gfx_ctx_wl_init(void *video_driver)
|
||||
/* Bind SHM based wl_buffer to wl_surface until the vulkan surface is ready.
|
||||
* This shows the window which assigns us a display (wl_output)
|
||||
* which is usefull for HiDPI and auto selecting a display for fullscreen. */
|
||||
draw_splash_screen(wl);
|
||||
if (!draw_splash_screen(wl))
|
||||
RARCH_ERR("[Wayland/GL]: Failed to draw splash screen\n");
|
||||
|
||||
wl_display_roundtrip(wl->input.dpy);
|
||||
|
||||
|
@ -519,7 +519,8 @@ static void *gfx_ctx_wl_init(void *video_driver)
|
||||
/* Bind SHM based wl_buffer to wl_surface until the vulkan surface is ready.
|
||||
* This shows the window which assigns us a display (wl_output)
|
||||
* which is usefull for HiDPI and auto selecting a display for fullscreen. */
|
||||
draw_splash_screen(wl);
|
||||
if (!draw_splash_screen(wl))
|
||||
RARCH_ERR("[Wayland/Vulkan]: Failed to draw splash screen\n");
|
||||
|
||||
wl_display_roundtrip(wl->input.dpy);
|
||||
|
||||
|
@ -1027,6 +1027,9 @@ shm_buffer_t *create_shm_buffer(gfx_ctx_wayland_data_t *wl, int width,
|
||||
stride = width * 4;
|
||||
size = stride * height;
|
||||
|
||||
if (size <= 0)
|
||||
return NULL;
|
||||
|
||||
fd = create_shm_file(size);
|
||||
if (fd < 0) {
|
||||
RARCH_ERR("[Wayland] [SHM]: Creating a buffer file for %d B failed: %s\n",
|
||||
@ -1084,7 +1087,7 @@ void shm_buffer_paint_checkerboard(shm_buffer_t *buffer,
|
||||
}
|
||||
|
||||
|
||||
void draw_splash_screen(gfx_ctx_wayland_data_t *wl)
|
||||
bool draw_splash_screen(gfx_ctx_wayland_data_t *wl)
|
||||
{
|
||||
shm_buffer_t *buffer;
|
||||
|
||||
@ -1092,6 +1095,10 @@ void draw_splash_screen(gfx_ctx_wayland_data_t *wl)
|
||||
wl->width * wl->buffer_scale,
|
||||
wl->height * wl->buffer_scale,
|
||||
WL_SHM_FORMAT_XRGB8888);
|
||||
|
||||
if (buffer == NULL)
|
||||
return false;
|
||||
|
||||
shm_buffer_paint_checkerboard(buffer, wl->width,
|
||||
wl->height, wl->buffer_scale,
|
||||
16, 0xffbcbcbc, 0xff8e8e8e);
|
||||
@ -1103,5 +1110,6 @@ void draw_splash_screen(gfx_ctx_wayland_data_t *wl)
|
||||
wl->width * wl->buffer_scale,
|
||||
wl->height * wl->buffer_scale);
|
||||
wl_surface_commit(wl->surface);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ void shm_buffer_paint_checkerboard(shm_buffer_t *buffer,
|
||||
int width, int height, int scale,
|
||||
size_t chk, uint32_t bg, uint32_t fg);
|
||||
|
||||
void draw_splash_screen(gfx_ctx_wayland_data_t *wl);
|
||||
bool draw_splash_screen(gfx_ctx_wayland_data_t *wl);
|
||||
|
||||
extern const struct wl_keyboard_listener keyboard_listener;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user