From 2faa968ebfa51dc33cad3d4280b01db2b7d6dedf Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Sat, 9 Mar 2024 15:00:40 +0100 Subject: [PATCH] im-relay: fix text inputs created while a non-wlr node is focused --- src/core/seat/input-method-relay.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/seat/input-method-relay.cpp b/src/core/seat/input-method-relay.cpp index 534697bf3..026fab7d3 100644 --- a/src/core/seat/input-method-relay.cpp +++ b/src/core/seat/input-method-relay.cpp @@ -24,12 +24,14 @@ wf::input_method_relay::input_method_relay() auto& seat = wf::get_core_impl().seat; if (auto focus = seat->priv->keyboard_focus) { - auto surface = wf::node_to_view(focus)->get_keyboard_focus_surface(); - - if (surface && (wl_resource_get_client(wlr_text_input->resource) == - wl_resource_get_client(surface->resource))) + if (auto view = wf::node_to_view(focus)) { - wlr_text_input_v3_send_enter(wlr_text_input, surface); + auto surface = wf::node_to_view(focus)->get_keyboard_focus_surface(); + if (surface && (wl_resource_get_client(wlr_text_input->resource) == + wl_resource_get_client(surface->resource))) + { + wlr_text_input_v3_send_enter(wlr_text_input, surface); + } } } });