From 50019bc766686323eb87a514abe27dcd6a7f004b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 18 Jun 2024 17:09:29 -0400 Subject: [PATCH] minor comment changes --- macos/Sources/Ghostty/SurfaceView_AppKit.swift | 11 +++++++---- src/config/Config.zig | 14 ++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/macos/Sources/Ghostty/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/SurfaceView_AppKit.swift index 9b78b868c..b3c002d64 100644 --- a/macos/Sources/Ghostty/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_AppKit.swift @@ -480,10 +480,13 @@ extension Ghostty { let pos = self.convert(event.locationInWindow, from: nil) ghostty_surface_mouse_pos(surface, pos.x, frame.height - pos.y) - if let window = self.window as? TerminalWindow { - if !self.focused && window.focusFollowsMouse { - Ghostty.moveFocus(to: self) - } + // If focus follows mouse is enabled then move focus to this surface. + if let window = self.window as? TerminalWindow, + window.isKeyWindow && + window.focusFollowsMouse && + !self.focused + { + Ghostty.moveFocus(to: self) } } diff --git a/src/config/Config.zig b/src/config/Config.zig index 0f6e73117..6e10e63fb 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -421,12 +421,6 @@ command: ?[]const u8 = null, /// This is primarily useful for scripts or debugging. @"wait-after-command": bool = false, -// If true, when there are multiple split panes, the mouse selects the pane -// that is focused. -// -// Default is false. -@"focus-follows-mouse": bool = false, - /// The number of milliseconds of runtime below which we consider a process exit /// to be abnormal. This is used to show an error message when the process exits /// too quickly. @@ -753,6 +747,14 @@ keybind: Keybinds = .{}, /// This configuration currently only works with GTK. @"window-new-tab-position": WindowNewTabPosition = .current, +// If true, when there are multiple split panes, the mouse selects the pane +// that is focused. This only applies to the currently focused window; i.e. +// mousing over a split in an unfocused window will now focus that split +// and bring the window to front. +// +// Default is false. +@"focus-follows-mouse": bool = false, + /// When enabled, the full GTK titlebar is displayed instead of your window /// manager's simple titlebar. The behavior of this option will vary with your /// window manager.