mirror of
				https://github.com/ghostty-org/ghostty.git
				synced 2025-10-26 12:27:29 +00:00 
			
		
		
		
	Add quick-terminal-space-behavior option
This commit is contained in:
		 Soh Satoh
					Soh Satoh
				
			
				
					committed by
					
						 Mitchell Hashimoto
						Mitchell Hashimoto
					
				
			
			
				
	
			
			
			 Mitchell Hashimoto
						Mitchell Hashimoto
					
				
			
						parent
						
							2206c509be
						
					
				
				
					commit
					e2523c25cb
				
			| @@ -0,0 +1,36 @@ | ||||
| import Foundation | ||||
| import Cocoa | ||||
|  | ||||
| enum QuickTerminalSpaceBehavior { | ||||
|     case remain | ||||
|     case move | ||||
|  | ||||
|     init?(fromGhosttyConfig string: String) { | ||||
|         switch (string) { | ||||
|             case "move": | ||||
|                 self = .move | ||||
|  | ||||
|             case "remain": | ||||
|                 self = .remain | ||||
|  | ||||
|             default: | ||||
|                 return nil | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     var collectionBehavior: NSWindow.CollectionBehavior { | ||||
|         let commonBehavior: [NSWindow.CollectionBehavior] = [ | ||||
|             .ignoresCycle, | ||||
|             .fullScreenAuxiliary | ||||
|         ] | ||||
|  | ||||
|         switch (self) { | ||||
|             case .move: | ||||
|                 // We want this to be part of every space because it is a singleton. | ||||
|                 return NSWindow.CollectionBehavior([.canJoinAllSpaces] + commonBehavior) | ||||
|             case .remain: | ||||
|                 // We want this to move the window to the active space. | ||||
|                 return NSWindow.CollectionBehavior([.moveToActiveSpace] + commonBehavior) | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user