From 7806366eec8d631d97c42d05210bad39a8c8eaaf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 25 Sep 2024 09:48:47 -0700 Subject: [PATCH] core: fix up toggle_slide_terminal action for rebase --- include/ghostty.h | 1 + src/App.zig | 1 + src/Surface.zig | 6 ------ src/apprt/action.zig | 4 ++++ src/apprt/glfw.zig | 1 + src/apprt/gtk/App.zig | 1 + src/input/Binding.zig | 1 + 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/ghostty.h b/include/ghostty.h index b5dd1609b..38affd16e 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -507,6 +507,7 @@ typedef enum { GHOSTTY_ACTION_TOGGLE_FULLSCREEN, GHOSTTY_ACTION_TOGGLE_TAB_OVERVIEW, GHOSTTY_ACTION_TOGGLE_WINDOW_DECORATIONS, + GHOSTTY_ACTION_TOGGLE_SLIDE_TERMINAL, GHOSTTY_ACTION_GOTO_TAB, GHOSTTY_ACTION_GOTO_SPLIT, GHOSTTY_ACTION_RESIZE_SPLIT, diff --git a/src/App.zig b/src/App.zig index 2e8ac3cf6..369fc4288 100644 --- a/src/App.zig +++ b/src/App.zig @@ -324,6 +324,7 @@ pub fn performAction( .open_config => try rt_app.performAction(.app, .open_config, {}), .reload_config => try self.reloadConfig(rt_app), .close_all_windows => try rt_app.performAction(.app, .close_all_windows, {}), + .toggle_slide_terminal => try rt_app.performAction(.app, .toggle_slide_terminal, {}), } } diff --git a/src/Surface.zig b/src/Surface.zig index 007f561e0..e8bbb885f 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -3856,12 +3856,6 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool .toggle, ), - .toggle_slide_terminal => { - if (@hasDecl(apprt.Surface, "toggleSlideTerminal")) { - self.rt_surface.toggleSlideTerminal(); - } else log.warn("runtime doesn't implement toggleSlideTerminal", .{}); - }, - .select_all => { const sel = self.io.terminal.screen.selectAll(); if (sel) |s| { diff --git a/src/apprt/action.zig b/src/apprt/action.zig index 9ed89b5a3..6fd15ec9c 100644 --- a/src/apprt/action.zig +++ b/src/apprt/action.zig @@ -93,6 +93,9 @@ pub const Action = union(Key) { /// Toggle whether window directions are shown. toggle_window_decorations, + /// Toggle the slide terminal in or out. + toggle_slide_terminal, + /// Jump to a specific tab. Must handle the scenario that the tab /// value is invalid. goto_tab: GotoTab, @@ -176,6 +179,7 @@ pub const Action = union(Key) { toggle_fullscreen, toggle_tab_overview, toggle_window_decorations, + toggle_slide_terminal, goto_tab, goto_split, resize_split, diff --git a/src/apprt/glfw.zig b/src/apprt/glfw.zig index fb31f7c2b..a64ed0afc 100644 --- a/src/apprt/glfw.zig +++ b/src/apprt/glfw.zig @@ -196,6 +196,7 @@ pub const App = struct { .close_all_windows, .toggle_tab_overview, .toggle_window_decorations, + .toggle_slide_terminal, .goto_tab, .inspector, .render_inspector, diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 94fae8015..dc535868e 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -379,6 +379,7 @@ pub fn performAction( // Unimplemented .close_all_windows, .toggle_split_zoom, + .toggle_slide_terminal, .size_limit, .cell_size, .secure_input, diff --git a/src/input/Binding.zig b/src/input/Binding.zig index 73fb6aa47..986b9e7c8 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -578,6 +578,7 @@ pub const Action = union(enum) { .reload_config, .close_all_windows, .quit, + .toggle_slide_terminal, => .app, // These are app but can be special-cased in a surface context.