From 98ae1dbd10d79dc6586fd644c54599675f98bba0 Mon Sep 17 00:00:00 2001 From: Lars <134181853+bo2themax@users.noreply.github.com> Date: Wed, 5 Nov 2025 18:22:08 +0100 Subject: [PATCH] macOS: fix Dictation icon starting above the text, not below Partially fixes #8493. After dictating some texts, the icon still appears above, but it will return to its right position after resizing or `\n` (saying newline, not hitting enter). This behaviour is better than before, where the icon always appeared above. ### Reference: https://github.com/emacs-mirror/emacs/blob/9e905357bb5da9c0d54ec9d8a708ff0ac0411a09/src/nsterm.m#L7426 --- macos/Sources/Ghostty/SurfaceView_AppKit.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Ghostty/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/SurfaceView_AppKit.swift index 410646f6f..46014ac25 100644 --- a/macos/Sources/Ghostty/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_AppKit.swift @@ -1728,10 +1728,13 @@ extension Ghostty.SurfaceView: NSTextInputClient { // Ghostty coordinates are in top-left (0, 0) so we have to convert to // bottom-left since that is what UIKit expects + // when there's is no characters selected, + // width should be 0 so that dictation indicator + // can start in the right place let viewRect = NSMakeRect( x, frame.size.height - y, - max(width, cellSize.width), + width, max(height, cellSize.height)) // Convert the point to the window coordinates