From 008ed81d268a77b4e385713bd0a3bdc65de66756 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 20 Jul 2025 16:31:57 +1000 Subject: [PATCH] Fix #141777: Crash closing an unfocused window on Wayland --- intern/ghost/intern/GHOST_SystemWayland.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index 812b83b6c72..c059a2e9fad 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -5759,7 +5759,8 @@ static void text_input_handle_enter(void *data, zwp_text_input_v3 * /*zwp_text_input_v3*/, wl_surface *surface) { - if (!ghost_wl_surface_own(surface)) { + /* Can be null when closing a window, see: #141777. */ + if (!ghost_wl_surface_own_with_null_check(surface)) { return; } CLOG_DEBUG(LOG, "enter");