mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-29 14:38:35 +00:00
macos: clamp window size to screen size on screen parameter changes
Fixes #2462 This sets up a listener for screen parameter changes. This only triggers when a screen is added, removed, or a parameter such as its resolution changes. This doesn't trigger when a window is simply moved from one screen to another. On parameter change, we ensure that the window is within the bounds of the screen. As an exception, if the window was previously already outside the bounds of the screen, we don't move it back in.
This commit is contained in:
10
macos/Sources/Helpers/Xcode.swift
Normal file
10
macos/Sources/Helpers/Xcode.swift
Normal file
@@ -0,0 +1,10 @@
|
||||
import Foundation
|
||||
|
||||
/// True if we appear to be running in Xcode.
|
||||
func isRunningInXcode() -> Bool {
|
||||
if let _ = ProcessInfo.processInfo.environment["__XCODE_BUILT_PRODUCTS_DIR_PATHS"] {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user