ghostty/macos/Sources/Ghostty/FullscreenMode+Extension.swift
Sassan Haradji d9839dbae5 macos: add titled-visible-menu option to macos-non-native-fullscreen
Non-native fullscreen has certain limitations at the moment regarding
being truly fullscreen (taking all screen surface) and losing no
functionality when activated. Currently, tab functionality is lost when
non-native fullscreen is activated.

This commit introduces the `titled-visible-menu` mode for macOS
non-native fullscreen. Like `visible-menu` mode, it hides the dock and
uses its surface, leaving the menubar visible. This mode makes full use
of the screen (except for the menubar) while retaining the tabbar’s
functionality.

While a truly fullscreen non-native mode without feature loss is ideal,
this implementation provides a functional alternative in the meantime.
2025-07-13 01:42:11 +04:00

27 lines
690 B
Swift

import GhosttyKit
extension FullscreenMode {
/// Initialize from a Ghostty fullscreen action.
static func from(ghostty: ghostty_action_fullscreen_e) -> Self? {
return switch ghostty {
case GHOSTTY_FULLSCREEN_NATIVE:
.native
case GHOSTTY_FULLSCREEN_NON_NATIVE:
.nonNative
case GHOSTTY_FULLSCREEN_NON_NATIVE_VISIBLE_MENU:
.nonNativeVisibleMenu
case GHOSTTY_FULLSCREEN_NON_NATIVE_PADDED_NOTCH:
.nonNativePaddedNotch
case GHOSTTY_FULLSCREEN_NON_NATIVE_TITLED_VISIBLE_MENU:
.nonNativeTitledVisibleMenu
default:
nil
}
}
}