From 608007673fb8ffb440e5678da357e9909be6da23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 10 Jun 2022 14:19:13 +0200 Subject: [PATCH] Wayland: Fix duplicate window content scale events The window content scale event was emitted every time the window content area was resized, even if its scale had not changed. (cherry picked from commit 0b76e3a6f158549b96d1ae3424f094c63177b2ce) --- README.md | 2 ++ src/wl_window.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d51894ad..cac5bc79 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,8 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Window maximization events were not emitted - [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode - [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window + - [Wayland] Bugfix: A window content scale event would be emitted every time + the window resized ## Contact diff --git a/src/wl_window.c b/src/wl_window.c index c8a69291..d8fb0c90 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -356,7 +356,6 @@ static void resizeWindow(_GLFWwindow* window) if (!window->wl.transparent) setOpaqueRegion(window); _glfwInputFramebufferSize(window, scaledWidth, scaledHeight); - _glfwInputWindowContentScale(window, scale, scale); if (!window->wl.decorations.top.surface) return; @@ -403,6 +402,7 @@ static void checkScaleChange(_GLFWwindow* window) { window->wl.scale = maxScale; wl_surface_set_buffer_scale(window->wl.surface, maxScale); + _glfwInputWindowContentScale(window, maxScale, maxScale); resizeWindow(window); } }