From 758d4b1987148c5b73dcff3267a2b6102e90a563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 21 Jun 2022 19:37:35 +0200 Subject: [PATCH] Wayland: Make function behavior match name The logic that checks the decorated attribute belongs on the outside along with other related checks (fullscreen, monitor, decoration mode). (cherry picked from commit c4fbe80d90ac7f4bd2fc0f02afccdc4d45489cbf) --- src/wl_window.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index b11dd02d..482d90c6 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -262,7 +262,7 @@ static void createFallbackDecorations(_GLFWwindow* window) unsigned char data[] = { 224, 224, 224, 255 }; const GLFWimage image = { 1, 1, data }; - if (!_glfw.wl.viewporter || !window->decorated) + if (!_glfw.wl.viewporter) return; if (!window->wl.decorations.buffer) @@ -318,7 +318,10 @@ static void xdgDecorationHandleConfigure(void* userData, window->wl.xdg.decorationMode = mode; if (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE) - createFallbackDecorations(window); + { + if (window->decorated) + createFallbackDecorations(window); + } else destroyFallbackDecorations(window); } @@ -489,7 +492,10 @@ static void releaseMonitor(_GLFWwindow* window) setIdleInhibitor(window, GLFW_FALSE); if (window->wl.xdg.decorationMode != ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE) - createFallbackDecorations(window); + { + if (window->decorated) + createFallbackDecorations(window); + } } static void xdgToplevelHandleConfigure(void* userData, @@ -690,7 +696,10 @@ static GLFWbool createShellObjects(_GLFWwindow* window) zxdg_toplevel_decoration_v1_set_mode(window->wl.xdg.decoration, mode); } else - createFallbackDecorations(window); + { + if (window->decorated) + createFallbackDecorations(window); + } } if (window->minwidth != GLFW_DONT_CARE && window->minheight != GLFW_DONT_CARE)