macos: support dropping folder with window

This commit is contained in:
Mitchell Hashimoto
2023-10-03 22:07:58 -07:00
parent 6249621d71
commit 96b8fbb84d
2 changed files with 4 additions and 2 deletions

View File

@ -152,7 +152,9 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, GhosttyApp
return true
}
return false
// Add a new tab
windowManager.addNewTab(to: mainWindow, withBaseConfig: config)
return true
}
/// This is called for the dock right-click menu.

View File

@ -133,7 +133,7 @@ class PrimaryWindowManager {
self.addNewTab(to: window, withBaseConfig: config)
}
private func addNewTab(to window: NSWindow, withBaseConfig config: Ghostty.SurfaceConfiguration? = nil) {
func addNewTab(to window: NSWindow, withBaseConfig config: Ghostty.SurfaceConfiguration? = nil) {
guard let controller = createWindowController(withBaseConfig: config, cascade: false) else { return }
guard let newWindow = addManagedWindow(windowController: controller)?.window else { return }
window.addTabbedWindow(newWindow, ordered: .above)