Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-18 09:48:58 +0300
committerCampbell Barton <campbell@blender.org>2022-06-18 09:50:25 +0300
commit881d1c9bc234e203cff033ea02998ce99f3070cd (patch)
treedd5dea6ee4510f969e749e260b9d130643e6dbbe
parent35b2b9b6e6079902d78602afce10e2e3bb9e6b40 (diff)
Fix crash in wayland when closing a window
The focus_pointer only pointer was only cleared when the window existed, which caused a dangling focus_pointer when closing a window.
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 2d1337df1de..bff96b3c0a4 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1161,12 +1161,13 @@ static void pointer_handle_leave(void *data,
uint32_t /*serial*/,
struct wl_surface *surface)
{
+ /* First clear the `focus_pointer`, since the window won't exist when closing the window. */
+ static_cast<input_t *>(data)->focus_pointer = nullptr;
+
GHOST_IWindow *win = window_from_surface(surface);
if (!win) {
return;
}
-
- static_cast<input_t *>(data)->focus_pointer = nullptr;
static_cast<GHOST_WindowWayland *>(win)->deactivate();
}