Commit Graph

17483 Commits

Author SHA1 Message Date
mcrmck
412cd30cd2 Fix synthetic '+' tab rendering and make it always-visible as a new-tab button
- Skip user tab_title_template for synthetic tabs (tab_id < 0) so custom
  templates referencing layout_name no longer produce '? +' during drags
- Always append the '+' drop indicator to tab_bar_data (not only during
  window drags), making it a persistent clickable new-tab button
- Handle click on the '+' tab (tab_id == -1) in the tab bar mouse handler
  by calling new_tab() on left-button release
2026-03-22 13:06:30 -04:00
mcrmck
b8da1d285f Add '+' tab indicator when dragging a window over empty tab bar space
Appends a synthetic TabBarData(tab_id=-1, title='+') to tab_bar_data
while a window drag is active. The existing tab highlight machinery
(_set_drag_target_tab / mark_tab_bar_dirty) handles hover highlighting
with no extra state. Dropping on it falls through the existing new-tab
branch in on_window_drop (tab_for_id(-1) returns None). Mark tab bar
dirty at drag start so the indicator appears immediately, and again
after set_window_being_dragged() on drop so it clears right away.
2026-03-20 20:48:10 -04:00
mcrmck
8dd4aaf111 Remove debug logging; clean up on_window_drop clear ordering 2026-03-20 01:37:19 -04:00
mcrmck
5c0a4accb3 Fix two bugs: splits layout corruption and overlay stuck on early drop exit
splits.py: insert_window_next_to called split_and_add on self.pairs_root
instead of on the pair found by pair_for_window. split_and_add only handles
direct children, so nested dest windows fell to 'else: self.two = pair',
silently replacing an entire subtree. Lost windows were re-added by
do_layout, producing phantom panes.

tabs.py: on_window_drop returned early (window not found) before calling
_clear_force_show_title_bars, leaving the drag overlay stuck on screen.
2026-03-20 01:34:01 -04:00
mcrmck
940b8bf1d3 Fix drag overlay: separate title bar highlight from body hover overlay
quadrant=5: title bar hover — full window overlay + title bar highlight
quadrant=6: body hover (non-Splits) — full window overlay only
quadrant=1-4: Splits body hover — directional half-window overlay

Previously quadrant=5 was used for all full-window cases, causing
is_drag_target=True to fire on body hover which incorrectly lit up
the title bar highlight whenever hovering any window body.
2026-03-20 01:23:23 -04:00
mcrmck
2bf4da9724 Fix: full-window overlay for title bar hover in Splits layout 2026-03-20 01:16:59 -04:00
mcrmck
2c81a69aad Add drag-and-drop quadrant preview overlay
During a window title-bar drag, render a semi-transparent tint over
the destination window to preview the drop outcome:

- Full-window tint (quadrant=5) when hovering any window in swap-based
  layouts (Tall, Stack, Fat, etc.) or over a title bar — swap is the
  result so the whole window is highlighted.
- Half-window directional tint (quadrant 1-4) when hovering in the
  Splits layout — a real directional insert happens so only the target
  half is highlighted.
- 150ms fade-in; clears immediately on drop or drag exit.

Implementation follows the visual_bell TINT_PROGRAM infrastructure:
two new Screen fields (start_drag_overlay_at, drag_overlay_quadrant),
draw_drag_preview_overlay() in shaders.c called from draw_cells() after
both render paths, set_window_drag_overlay() C→Python bridge in state.c,
and the same child-monitor.c needs_render + set_maximum_wait hooks that
visual_bell uses to keep frames firing during animation.

Layout detection uses hasattr(layout, 'insert_window_next_to') — the
same guard _insert_window_in_direction uses internally — so the overlay
always matches the actual drop behavior.
2026-03-18 00:30:37 -04:00
mcrmck
39820e79ff Fix mypy error: remove invalid 'none' check on window_title_bar option 2026-03-17 23:36:03 -04:00
mcrmck
49f6c926e0 Fix window drag-drop: force-show title bars and add new-tab drop target
- start_window_drag now force-shows title bars on all tabs during a drag
  so the user can actually drop onto them to trigger a swap. The cleanup
  code to clear force_show_title_bars already existed but the corresponding
  set was never written.

- on_window_drop_move now only highlights a destination window's title bar
  when the cursor is actually within the title bar row, so the visual
  feedback accurately reflects what will happen on drop (swap vs split).

- Dropping a window onto the empty space in the tab bar (past the last tab)
  now creates a new tab and moves the window into it.
2026-03-17 23:26:55 -04:00
mcrmck
462f7025fb Merge upstream/master into feat-draggable-window-title-bars
Resolves conflict in kitty/tabs.py by keeping both force_show_title_bars
and renaming_in_window fields.
2026-03-17 22:40:28 -04:00
Kovid Goyal
ecf497b5ab Merge branch 'ls-title-overridden' of https://github.com/dannydulai/kitty 2026-03-17 22:11:42 +05:30
Danny Dulai
226195d18c Add title_overridden field to kitty @ ls output 2026-03-17 12:25:44 -04:00
Kovid Goyal
61421c9763 ... 2026-03-17 21:27:20 +05:30
Kovid Goyal
6360525a2a Fix shadow being drawn over notch area child window 2026-03-17 21:07:32 +05:30
Kovid Goyal
0321ca04f0 Cleanup previous PR
Fix leak of sub view and ensure child window has correct color space
2026-03-17 20:14:02 +05:30
Kovid Goyal
42305c3464 Merge branch 'safe-area-insets' of https://github.com/dannydulai/kitty 2026-03-17 19:55:19 +05:30
Danny Dulai
489473a8cf Add macOS notch avoidance for traditional fullscreen
Position the window below the notch by reducing the frame height by
safeAreaInsets.top. Create a fullscreen child window behind it with a
colored subview covering just the notch strip, matching the terminal
background color and opacity.

Also fix background_opacity not triggering a chrome update on config
reload.
2026-03-17 10:06:57 -04:00
Kovid Goyal
0479962dd7 Update changelog 2026-03-17 14:29:56 +05:30
copilot-swe-agent[bot]
3862ae26cc Fix fuzzy match highlighting in choose_files kitten
Fixes #9693
2026-03-17 14:28:56 +05:30
Kovid Goyal
f2734fcfbd Cleanup copilot code 2026-03-17 13:39:07 +05:30
copilot-swe-agent[bot]
e98f80d836 Prevent multiple stacking Rename tab overlay windows
Fixes #9691
Fixes #9692
2026-03-17 13:37:08 +05:30
Kovid Goyal
f57eb74dbe Update changelog 2026-03-17 09:31:51 +05:30
Kovid Goyal
8457258f26 ... 2026-03-17 09:30:23 +05:30
Kovid Goyal
6704f359a9 Update changelog 2026-03-17 08:57:30 +05:30
copilot-swe-agent[bot]
877be65447 Fix crashes when moving tab between OS windows (issue #9677)
Wayland (glfw/wl_window.c):
- Fix out-of-bounds access in send_drag_data: look up item by MIME type
  instead of using the data-request index i to index _glfw.drag.items[].
  The compositor calls drag_source_send once per target window entered,
  so _glfw.wl.drag.count grows independently of item_count, causing
  _glfw.drag.items[i] to be out-of-bounds on the second drag, yielding a
  garbage optional_data pointer that made write() fail with EFAULT.
- Fix protocol error "Drag has not ended": change on_fail and the
  GLFW_DRAG_DATA_REQUEST error path to call finish_drag_write(i)+return
  instead of cancel_drag(), which was calling wl_data_source_destroy()
  before the compositor ended the drag, violating the Wayland protocol.
- Fix double-free of dr.pending_data: null the pointer after free and
  add cleanup to finish_drag_write().
- Fix missing finish_drag_write() after a full write in data-request
  mode, which left the pipe open causing the target to wait for EOF.

X11 (glfw/x11_window.c):
- Wrap XSendEvent() calls in send_xdnd_enter/position/leave/drop with
  _glfwGrabErrorHandlerX11()/_glfwReleaseErrorHandlerX11(). A target
  window destroyed between discovery and message delivery produced a
  BadWindow error that hit the default X11 abort handler. Now handled
  gracefully by clearing current_target or cancelling the drag."

Fixes #9677
Fixes #9683
2026-03-17 08:53:17 +05:30
Kovid Goyal
ad53a5bdff Cleanup previous PR 2026-03-17 08:40:56 +05:30
copilot-swe-agent[bot]
25f97f4ce5 Implement on_quit event for global watchers
Fixes #9682
2026-03-17 08:37:30 +05:30
Kovid Goyal
02a34ecd04 Fix #9684 2026-03-17 08:32:38 +05:30
Kovid Goyal
c977d1edcb ... 2026-03-17 08:22:45 +05:30
Kovid Goyal
77821f6321 Fix #9679 2026-03-17 08:21:11 +05:30
Kovid Goyal
83160c10c4 Cleanup previous PR 2026-03-16 17:38:14 +05:30
copilot-swe-agent[bot]
d97850274f Implement Python vectorcall calling convention for Color type in colors.c
Fixes #9674
2026-03-16 17:09:39 +05:30
copilot-swe-agent[bot]
780b4337e4 Fix move_tab_forward/backward with tab_bar_filter
When tab_bar_filter is used (e.g. with sessions), move_tab() was using
self.active_tab_idx (index in the full tabs list) as an index into the
filtered tabs list, causing incorrect behavior.

Also fix the same bug in tab_at_location() for left/right locations.

Fixes #9672
Fixes #9673
2026-03-16 17:05:40 +05:30
Kovid Goyal
40f9945ea7 version 0.46.1 v0.46.1 2026-03-16 13:20:03 +05:30
Kovid Goyal
f4d4a80ca3 Merge branch 'dependabot/go_modules/all-go-deps-48d5999cd7' of https://github.com/kovidgoyal/kitty 2026-03-16 09:19:20 +05:30
Kovid Goyal
0c90b66f91 ... 2026-03-16 09:18:50 +05:30
dependabot[bot]
1f2149eb6f Bump golang.org/x/sys from 0.41.0 to 0.42.0 in the all-go-deps group
Bumps the all-go-deps group with 1 update: [golang.org/x/sys](https://github.com/golang/sys).


Updates `golang.org/x/sys` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/sys/compare/v0.41.0...v0.42.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 03:43:04 +00:00
Kovid Goyal
ddfd8d7f45 Wayland: Dont set window icons on layer shell windows as some compositors complain about them 2026-03-16 08:28:36 +05:30
copilot-swe-agent[bot]
66ffb6895c Fix macOS keyboard focus not restored when switching back from another space
Fixes #9665
Fixes #9666
2026-03-15 14:57:46 +05:30
Kovid Goyal
b3b7d0596d Dont use neighboring tab colors for tab bar margins on translucent OS windows
The colors are rendered semi-transparent which effectively means they blend
with background unlike the neighboring colors and end up not matching
2026-03-15 09:22:43 +05:30
copilot-swe-agent[bot]
b93f1badd1 Fix tab bar border artifacts with background_opacity on non-cell-aligned windows
Fixes #9663: visible gray/black bars appear at the left and right
sides of the tab bar when background_opacity is set and the window width
is not a multiple of the cell width.

Three fixes in update_blank_rects:

1. Fix off-by-one: use g.right instead of g.right-1 for the right blank
   rect start position. The old code caused a 1-pixel overlap with tab
   content and spuriously added a right blank rect even for
   perfectly-aligned windows.

2. Fix blank rect colors: only use tab_bar_left/right_edge_color when
   tab_bar_margin_width > 0 (explicit configured margin). When
   margin_width=0 (default), use default_bg which blends with the window
   background instead of showing a solid tab-colored bar.

3. Fix inner margin BOTTOM_EDGE height: use tab_bar.top instead of vh
   so the inner margin blank rect covers only the inner margin area.

Fixes #9664

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-15 09:00:41 +05:30
Kovid Goyal
30756bb819 Cleanup previous PR 2026-03-15 08:38:59 +05:30
Kovid Goyal
d244a697bf Merge branch 'dictation_fix' of https://github.com/alexeyshurygin/kitty 2026-03-15 08:34:46 +05:30
Alexey Shurygin
827c8dd614 Address PR review feedback 2026-03-15 01:33:38 +03:00
Alexey Shurygin
b66c6c4932 Fix: Dictation does not start on double Fn key press on Mac OS 2026-03-15 01:15:05 +03:00
Kovid Goyal
e72f49952d Linux: Fix regression that broke drag and drop from GTK applications
Fixes #9656
2026-03-13 20:19:33 +05:30
copilot-swe-agent[bot]
a97f468a02 Add remove_duplicate_mimes() and call it from update_allowed_mimes_for_drop()
Fixes #9657
2026-03-13 20:01:43 +05:30
Kovid Goyal
c332211997 Possible fix for #9656 2026-03-13 19:16:44 +05:30
Kovid Goyal
98931d99b0 Wayland: Fix momentum scrolling not working on compositors that send a stop frame with no axis information
Fixes #9653
2026-03-13 08:47:45 +05:30
Kovid Goyal
5585b773bf Merge branch 'master' of https://github.com/1024th/kitty 2026-03-13 08:23:39 +05:30