From a199efae44d5bc17d2223440fef3afc28a659e90 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 3 Dec 2017 03:56:39 +0100 Subject: [PATCH] Wayland: Emit an error when wl_shell is absent or unusable --- src/wl_window.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wl_window.c b/src/wl_window.c index cb4638eb..108218b8 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -236,10 +236,21 @@ static GLFWbool createSurface(_GLFWwindow* window, static GLFWbool createShellSurface(_GLFWwindow* window) { + if (!_glfw.wl.shell) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Wayland: wl_shell protocol not available"); + return GLFW_FALSE; + } + window->wl.shellSurface = wl_shell_get_shell_surface(_glfw.wl.shell, window->wl.surface); if (!window->wl.shellSurface) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Wayland: Shell surface creation failed"); return GLFW_FALSE; + } wl_shell_surface_add_listener(window->wl.shellSurface, &shellSurfaceListener,