Wayland: Fix reporting of monitor scale changes

Content scale events would be emitted when a window surface entered or
left an output, but not when one of a window's current outputs had its
scale changed.

(cherry picked from commit e37ba80b13)
This commit is contained in:
Camilla Löwy
2022-06-14 18:46:47 +02:00
parent 557da4cdc4
commit 48e0e0acf5
4 changed files with 18 additions and 3 deletions
+12
View File
@@ -111,6 +111,18 @@ static void outputHandleScale(void* userData,
struct _GLFWmonitor* monitor = userData;
monitor->wl.scale = factor;
for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next)
{
for (int i = 0; i < window->wl.monitorsCount; i++)
{
if (window->wl.monitors[i] == monitor)
{
_glfwUpdateContentScaleWayland(window);
break;
}
}
}
}
#ifdef WL_OUTPUT_NAME_SINCE_VERSION