From 57e7565b7f05f466621d33487da382d0b8c7809e Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Sat, 8 Feb 2025 16:23:23 -0600 Subject: [PATCH] gtk: make goto_split a performable action --- src/apprt/gtk/App.zig | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 85ec80f47..e7974495a 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -531,7 +531,7 @@ pub fn performAction( .new_split => try self.newSplit(target, value), .resize_split => self.resizeSplit(target, value), .equalize_splits => self.equalizeSplits(target), - .goto_split => self.gotoSplit(target, value), + .goto_split => return self.gotoSplit(target, value), .open_config => try configpkg.edit.open(self.core_app.alloc), .config_change => self.configChange(target, value.config), .reload_config => try self.reloadConfig(target, value), @@ -671,18 +671,24 @@ fn gotoSplit( _: *const App, target: apprt.Target, direction: apprt.action.GotoSplit, -) void { +) bool { switch (target) { - .app => {}, + .app => { + return false; + }, .surface => |v| { - const s = v.rt_surface.container.split() orelse return; + const s = v.rt_surface.container.split() orelse return false; const map = s.directionMap(switch (v.rt_surface.container) { .split_tl => .top_left, .split_br => .bottom_right, .none, .tab_ => unreachable, }); - const surface_ = map.get(direction) orelse return; - if (surface_) |surface| surface.grabFocus(); + const surface_ = map.get(direction) orelse return false; + if (surface_) |surface| { + surface.grabFocus(); + return true; + } + return false; }, } }