From 8ed91e8a77c7483d3903e781246ac1c0ca1b0c60 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 22 Dec 2017 17:29:25 +0100 Subject: [PATCH] Only create decorations if wp_viewporter is supported --- src/wl_window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wl_window.c b/src/wl_window.c index 577c4b74..aea3b55a 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -238,6 +238,9 @@ static void createDecorations(_GLFWwindow* window) unsigned char data[] = { 224, 224, 224, 255 }; const GLFWimage image = { 1, 1, data }; + if (!_glfw.wl.viewporter) + return; + struct wl_buffer* buffer = createShmBuffer(&image); createDecoration(&window->wl.decorations.top, window->wl.surface, buffer, @@ -276,6 +279,9 @@ static void resizeWindow(_GLFWwindow* window, int width, int height) { wl_egl_window_resize(window->wl.native, width, height, 0, 0); + if (!_glfw.wl.viewporter) + return; + // Top decoration. wp_viewport_set_destination(window->wl.decorations.top.viewport, width, _GLFW_DECORATION_TOP); wl_surface_commit(window->wl.decorations.top.surface);