From 55ed16efd1fedb67eaa91d9d94b258a729f67ab6 Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 31 Dec 2023 17:39:32 +0000 Subject: [PATCH] input-method: address nits --- river/InputRelay.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/river/InputRelay.zig b/river/InputRelay.zig index bdd1022..d3ffb6a 100644 --- a/river/InputRelay.zig +++ b/river/InputRelay.zig @@ -94,8 +94,12 @@ fn handleInputMethodDestroy( input_method: *wlr.InputMethodV2, ) void { const self = @fieldParentPtr(Self, "input_method_destroy", listener); - assert(input_method == self.input_method); + + self.input_method_commit.link.remove(); + self.grab_keyboard.link.remove(); + self.input_method_destroy.link.remove(); + self.input_method = null; const text_input = self.getFocusedTextInput() orelse return; @@ -182,10 +186,8 @@ pub fn sendInputMethodState(self: *Self, wlr_text_input: *wlr.TextInputV3) void } input_method.sendDone(); - // TODO: pass intent, display popup size } -/// Update the current focused surface. Surface must belong to the same seat. pub fn setSurfaceFocus(self: *Self, wlr_surface: ?*wlr.Surface) void { var new_text_input: ?*TextInput = null; @@ -210,6 +212,7 @@ pub fn setSurfaceFocus(self: *Self, wlr_surface: ?*wlr.Surface) void { if (wlr_surface) |surface| { if (text_input.wlr_text_input.resource.getClient() == surface.resource.getClient()) { + assert(new_text_input == null); new_text_input = text_input; } }