native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #27 from onevcat/feature/ghostty-window-actions

feat: implement fullscreen, maximize and background opacity toggles

authored by

Wei Wang and committed by
GitHub
f0eb28bb e7af7dc6

+19 -1
+11
supacode/Infrastructure/Ghostty/GhosttySurfaceBridge.swift
··· 64 64 return onMoveTab?(action.action.move_tab) ?? false 65 65 case GHOSTTY_ACTION_TOGGLE_COMMAND_PALETTE: 66 66 return onCommandPaletteToggle?() ?? false 67 + case GHOSTTY_ACTION_TOGGLE_FULLSCREEN: 68 + surfaceView?.window?.toggleFullScreen(nil) 69 + return true 70 + case GHOSTTY_ACTION_TOGGLE_MAXIMIZE: 71 + if let window = surfaceView?.window { 72 + window.zoom(nil) 73 + } 74 + return true 75 + case GHOSTTY_ACTION_TOGGLE_BACKGROUND_OPACITY: 76 + surfaceView?.toggleBackgroundOpacity() 77 + return true 67 78 case GHOSTTY_ACTION_GOTO_WINDOW, 68 79 GHOSTTY_ACTION_TOGGLE_QUICK_TERMINAL, 69 80 GHOSTTY_ACTION_CLOSE_ALL_WINDOWS:
+8 -1
supacode/Infrastructure/Ghostty/GhosttySurfaceView.swift
··· 68 68 private var eventMonitor: Any? 69 69 private var notificationObservers: [NSObjectProtocol] = [] 70 70 private var prevPressureStage: Int = 0 71 + private var isBackgroundOpaqueOverride = false 71 72 private lazy var cachedScreenContents = CachedValue<String>(duration: .milliseconds(500)) { 72 73 [weak self] in 73 74 self?.readScreenContents() ?? "" ··· 353 354 addCursorRect(bounds, cursor: currentCursor) 354 355 } 355 356 357 + func toggleBackgroundOpacity() { 358 + guard runtime.backgroundOpacity() < 1 else { return } 359 + isBackgroundOpaqueOverride.toggle() 360 + applyWindowBackgroundAppearance() 361 + } 362 + 356 363 private func applyWindowBackgroundAppearance() { 357 364 guard let window, window.isVisible else { return } 358 365 let opacity = runtime.backgroundOpacity() 359 - if !window.styleMask.contains(.fullScreen), opacity < 1 { 366 + if !isBackgroundOpaqueOverride, !window.styleMask.contains(.fullScreen), opacity < 1 { 360 367 window.isOpaque = false 361 368 window.titlebarAppearsTransparent = true 362 369 window.backgroundColor = .white.withAlphaComponent(0.001)