git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit995e1047db83e17267eee365dc0afc22da4e6edd
parentc240abac43
authorpraschke <[email protected]>
date2023-12-31 17:39
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;
             }
         }