gtk: implement quick-terminal-screen for Wayland

Implement the quick-terminal-screen config option on Linux/Wayland so
users can pin the quick terminal to a specific monitor instead of
always following the mouse cursor.

Use the kde_output_order_v1 protocol to identify the compositor's
primary monitor by connector name (e.g. "DP-1"). When the protocol is
unavailable, fall back to the first monitor in the GDK list.

- Add resolveQuickTerminalMonitor() to map config values to a
  gdk.Monitor: .mouse returns null (compositor decides), .main and
  .macos-menu-bar match by connector name via the protocol
- Call layer_shell.setMonitor() in both initQuickTerminal and
  syncQuickTerminal so config reloads take effect
- Update enteredMonitor to size the window using the configured
  monitor rather than whichever monitor was entered
- Update config documentation to reflect Linux support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jake Guthmiller
2026-02-07 20:22:15 -06:00
parent 96f8f0d93c
commit 6da660a9a5
2 changed files with 128 additions and 8 deletions

View File

@@ -2680,7 +2680,13 @@ keybind: Keybinds = .{},
/// The default value is `main` because this is the recommended screen
/// by the operating system.
///
/// Only implemented on macOS.
/// On macOS, `macos-menu-bar` uses the screen containing the menu bar.
/// On Linux/Wayland, `macos-menu-bar` is treated as equivalent to `main`.
///
/// Note: On Linux, there is no universal concept of a "primary" monitor.
/// Ghostty uses the compositor-reported primary output when available and
/// falls back to the first monitor reported by GDK if no primary output can
/// be resolved.
@"quick-terminal-screen": QuickTerminalScreen = .main,
/// Duration (in seconds) of the quick terminal enter and exit animation.