From d3a7362430a2a0073009c8f4ca9fd4e494b0418f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Feb 2024 21:34:15 +0100 Subject: [PATCH] Wayland: Separate window and framebuffer resizing --- src/wl_window.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index d7f12660..94970d14 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -306,8 +306,7 @@ static void setContentAreaOpaque(_GLFWwindow* window) wl_region_destroy(region); } - -static void resizeWindow(_GLFWwindow* window) +static void resizeFramebuffer(_GLFWwindow* window) { int scale = window->wl.contentScale; int scaledWidth = window->wl.width * scale; @@ -315,9 +314,16 @@ static void resizeWindow(_GLFWwindow* window) if (window->wl.egl.window) wl_egl_window_resize(window->wl.egl.window, scaledWidth, scaledHeight, 0, 0); + if (!window->wl.transparent) setContentAreaOpaque(window); + _glfwInputFramebufferSize(window, scaledWidth, scaledHeight); +} + +static void resizeWindow(_GLFWwindow* window) +{ + resizeFramebuffer(window); if (!window->wl.decorations.top.surface) return; @@ -363,7 +369,7 @@ void _glfwUpdateContentScaleWayland(_GLFWwindow* window) window->wl.contentScale = maxScale; wl_surface_set_buffer_scale(window->wl.surface, maxScale); _glfwInputWindowContentScale(window, maxScale, maxScale); - resizeWindow(window); + resizeFramebuffer(window); if (window->wl.visible) _glfwInputWindowDamage(window);