Skip to content

Commit 56edade

Browse files
ryanKkaiiiKkaiwz
authored andcommitted
fix(wayland): restore focus during window resize
On Wayland, when the user resizes a window, the compositor takes over input handling. This causes GLFW to receive a keyboardHandleLeave event, which it incorrectly interprets as the window losing focus. This will result in Platform::update() no longer executed, then the render result is incorrect. This patch forces focus to be restored in the window size callback on Wayland, ensuring that rendering continues during resize operations. Signed-off-by: Ryan Zhang <ryan.zhang@nxp.com>
1 parent fa2cf45 commit 56edade

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

framework/platform/glfw_window.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2019-2025, Arm Limited and Contributors
1+
/* Copyright (c) 2019-2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*
@@ -49,6 +49,11 @@ void window_size_callback(GLFWwindow *window, int width, int height)
4949
if (auto platform = reinterpret_cast<Platform *>(glfwGetWindowUserPointer(window)))
5050
{
5151
platform->resize(width, height);
52+
53+
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
54+
// On Wayland, window may lose focus during resize. Force focus to ensure rendering continues.
55+
platform->set_focus(true);
56+
#endif
5257
}
5358
}
5459

0 commit comments

Comments
 (0)