From 203002ef2c6a8518138eed981ba1e95cfe59c59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 15 Jun 2022 14:12:32 +0200 Subject: [PATCH] Wayland: Fix latent bug for glfwGetWindowTitle --- src/wl_window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 53175699..cc4a75bd 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1845,9 +1845,10 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window) void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title) { - if (window->wl.title) - _glfw_free(window->wl.title); - window->wl.title = _glfw_strdup(title); + char* copy = _glfw_strdup(title); + _glfw_free(window->wl.title); + window->wl.title = copy; + if (window->wl.xdg.toplevel) xdg_toplevel_set_title(window->wl.xdg.toplevel, title); }