mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: force cursor to be shown during clipboard paste confirmation
This commit is contained in:
@ -722,7 +722,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
||||
Ghostty.App.completeClipboardRequest(surface, data: "", state: state, confirmed: true)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Show our paste confirmation
|
||||
self.clipboardConfirmation = ClipboardConfirmationController(
|
||||
surface: surface,
|
||||
@ -732,5 +732,8 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
||||
delegate: self
|
||||
)
|
||||
window.beginSheet(self.clipboardConfirmation!.window!)
|
||||
|
||||
// Force the cursor to be shown when the sheet opens
|
||||
NSCursor.unhide()
|
||||
}
|
||||
}
|
||||
|
@ -508,9 +508,9 @@ extension Ghostty {
|
||||
// tab is created. In this scenario, we only want to process our
|
||||
// callback once since this is stateful and we expect balancing.
|
||||
if (mouseEntered) { return }
|
||||
|
||||
|
||||
mouseEntered = true
|
||||
|
||||
|
||||
// Update our cursor when we enter so we fully process our
|
||||
// cursorVisible state.
|
||||
cursorUpdate(with: NSEvent())
|
||||
@ -519,20 +519,15 @@ extension Ghostty {
|
||||
override func mouseExited(with event: NSEvent) {
|
||||
// See mouseEntered
|
||||
if (!mouseEntered) { return }
|
||||
|
||||
|
||||
mouseEntered = false
|
||||
|
||||
|
||||
// If the mouse is currently hidden, we want to show it when we exit
|
||||
// this view. We go through the cursorVisible dance so that only
|
||||
// cursorUpdate manages cursor state.
|
||||
if (cursorVisible == .hidden) {
|
||||
cursorVisible = .pendingVisible
|
||||
self.setCursorVisibility(true)
|
||||
cursorUpdate(with: NSEvent())
|
||||
assert(cursorVisible == .visible)
|
||||
|
||||
// We set the state to pending hidden again for the next time
|
||||
// we enter.
|
||||
cursorVisible = .pendingHidden
|
||||
}
|
||||
}
|
||||
|
||||
@ -584,16 +579,16 @@ extension Ghostty {
|
||||
case .visible, .hidden:
|
||||
// Do nothing, stable state
|
||||
break
|
||||
|
||||
|
||||
case .pendingHidden:
|
||||
NSCursor.hide()
|
||||
cursorVisible = .hidden
|
||||
|
||||
|
||||
case .pendingVisible:
|
||||
NSCursor.unhide()
|
||||
cursorVisible = .visible
|
||||
}
|
||||
|
||||
|
||||
cursor.set()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user