- Add freetype_text_width_for_single_line() in freetype_render_ui_text.c
- Add cocoa_text_width_for_single_line() in core_text.m
- Add text_width_for_single_line() wrapper in glfw.c for both platforms
- Modify draw_single_line_of_text() to accept optional max_width parameter
- Return (pixels, width) tuple instead of just pixels
- Update all Python call sites in tabs.py and window.py
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/508483db-ffcd-4d43-a8ee-83fcd3ec9c01
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Implements drag-to-reorder for window title bars, following up on the
merged window title bar feature (#9450) and the design discussion in #9619.
- Drag a title bar and drop on another title bar to swap positions
- Drop on a window body quadrant (left/right/top/bottom) to insert as
a directional split; Splits layout uses insert_window_next_to(), other
layouts fall back to move_window_to_group()
- Drop on a tab bar tab to move the window into that tab
- Drop on another OS window to move into its active tab
- Drop outside kitty to detach into a new OS window
- Tab bar highlights the hovered tab during a window drag, mirroring
how the destination window title bar is highlighted
- toggle_window_title_bars action temporarily force-shows title bars
for drag-to-reorder when they are normally hidden, auto-hiding after
the drag completes
- window_title_bar_drag_threshold option (default 5px) controls how far
the mouse must move before a drag is initiated; 0 disables dragging
MIME type follows the same convention as tab dragging:
application/net.kovidgoyal.kitty-window-{PID}
Ref: #9619
- Add window_title_bar_min_windows (0=never, 1=always, 2+=threshold)
similar to tab_bar_min_tabs, to control when title bars appear
- Remove 'none' choice from window_title_bar so it purely controls
position (top/bottom); disabling is now via min_windows 0
- Only hide title bar for truly empty template strings, not
whitespace-only, so users can have intentionally blank bars
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Eliminate double set_geometry() call: removed _apply_window_title_bars()
which post-processed geometry causing expensive SIGWINCH to children
- Move title bar screen ownership to Window objects instead of central
manager, with show_title_bar flag set during layout before do_layout()
- Window.set_geometry() now handles title bar geometry internally:
self.geometry stays at layout-computed value (borders/padding correct),
only C-side render data diverges via adjusted top/bottom
- Hide title bar for 1-row windows (ynum <= 1)
- Hide title bar when template evaluates to empty/whitespace
- Optimize C render loop: merge title bar GPU prep and draw into existing
per-window loops, use trd pointer and is_visible=false, use
num_visible_windows > 1 guard. Eliminates separate iteration passes.
- Simplify WindowTitleBarManager to thin coordinator
Note on C-side GPU prep placement: the suggested patch placed
send_cell_data_to_gpu for title bars inside the is_active_window branch
only. This caused a segfault (NULL deref in gleRunVertexSubmitImmediate)
because inactive windows' title bars had valid screen/geometry but no
GPU data uploaded, yet draw_cells was called for all visible title bars.
Moved to the per-window visibility block alongside the main window's
send_cell_data_to_gpu call so all visible title bars get GPU data
prepared. The draw loop matches the suggested patch exactly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a new keyboard action that copies the selected text to clipboard,
or if no selection exists, copies the last command output. This follows
the pattern of existing actions like copy_or_interrupt.
Opens the scrollback pager in search mode. Particularly useful for
newbies on macOS that are used to using cmd+f to trigger search mode.
If there is a current selection, it is automatically searched for.