From 227f6eb4f1b4f278f5e22dd62f3ea47fe2c9b615 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 25 Feb 2023 14:57:34 -0800 Subject: [PATCH] gtk: handle so it doesn't move focus --- src/apprt/gtk.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/apprt/gtk.zig b/src/apprt/gtk.zig index d74e6adbf..30cc9d092 100644 --- a/src/apprt/gtk.zig +++ b/src/apprt/gtk.zig @@ -881,7 +881,17 @@ pub const Surface = struct { return 0; }; - return 0; + // We generally just say we didn't handle it. We control our + // GTK environment so for any keys that matter we'll grab them. + // One of the reasons we say we didn't handle it is so that the + // IME can still work. + return switch (keyval) { + // If the key is tab, we say we handled it because we don't want + // tab to move focus from our surface. + c.GDK_KEY_Tab => 1, + + else => 0, + }; } fn gtkKeyReleased(