Commit Graph

1503 Commits

Author SHA1 Message Date
Kovid Goyal
6b9d449b0d Fix #9904 2026-04-22 07:43:57 +05:30
Owen Mead-Robins
44d530f82e Fix bug #9215 cmd+` now cycles windows properly on MacOS Tahoe 2026-04-21 11:52:12 -07:00
zhaolei
b16221a1d3 macos: explicitly enable modern window corners on macOS 26
Use an explicit runtime check to apply the newer corner styling on macOS 26 while leaving behavior unchanged on older macOS versions for compatibility.

Also add the required QuartzCore framework for linking the corner curve API.
2026-04-18 20:41:38 +08:00
Kovid Goyal
4076c43783 Report missing pointer-gestures protocol 2026-04-14 09:44:48 +05:30
Kovid Goyal
95593ef008 Wayland: Allow holding momentum scroll by putting two finger on touchpad. Fixes #9863 2026-04-14 09:39:57 +05:30
Petar Dobrev
a4170d4b59 Added macos_fullscreen_ignore_safe_area_insets option 2026-04-09 10:27:01 +03:00
Kovid Goyal
1c4097edde Remove unnecessary event pump when attaching top level drag surface 2026-04-07 17:25:18 +05:30
Kovid Goyal
837f55fe21 ... 2026-04-07 13:47:47 +05:30
copilot-swe-agent[bot]
a90b8470ac Fix drag icon not visible under GNOME Wayland
Fixes #9823
2026-04-07 13:31:04 +05:30
Kovid Goyal
cd3860817b ... 2026-04-07 11:47:58 +05:30
Kovid Goyal
9fbb079ad6 Add logging for DnD events on Wayland 2026-04-07 11:32:12 +05:30
Kovid Goyal
dc55052f0c Wayland: set drop accepted operations 2026-04-07 10:40:14 +05:30
z3rco
b39f88c6a2 Fix multiple security vulnerabilities across C, Python, and Go code
Timing-safe comparisons:
- crypto.c: Replace memcmp with CRYPTO_memcmp for Secret equality,
  require equal lengths before comparing
- remote_control.py: Constant-time password lookup to avoid leaking
  valid passwords via dict hash timing
- file_transmission.py: Use hmac.compare_digest for bypass token
  comparison instead of ==

Memory safety:
- child-monitor.c: Fix inverted condition in write_to_peer that
  prevented memmove from ever executing on partial writes
- ibus_glfw.c: Null-terminate IBUS_ADDRESS copy to prevent string
  overread when strlen >= PATH_MAX
- x11_window.c: Add NULL checks after realloc in clipboard/DnD
  data handling (two sites)
- dnd.c: Cap accepted_mimes at 1MB to prevent unbounded growth,
  fix realloc to not lose the original pointer on failure
- png-reader.c: Cast to size_t before multiplication to prevent
  integer overflow on 32-bit platforms

Secrets hygiene:
- disk-cache.c: Zero encryption_key with explicit_bzero before free

Tar extraction hardening:
- tar.go: Validate hardlink targets against destination prefix to
  prevent writing outside extraction directory
- tar.go: Strip setuid/setgid/sticky bits from extracted files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:10:46 +01:00
copilot-swe-agent[bot]
2f33460864 Add operations==-3 cancel drag support to glfwStartDrag
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/eff7e2c8-ab7a-4967-95b5-e65631245701

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-02 07:14:36 +00:00
Kovid Goyal
9721346387 XWayland: Fix a regression where some wheel mice were not scrolling properly
We assume increment == 1 and delta * 120 == integer means we have
V120 events in units of 1/120.

Fixes #9770
2026-03-29 14:43:48 +05:30
Kovid Goyal
9e79d3be9c Merge branch 'feat-draggable-window-title-bars' of https://github.com/mcrmck/kitty 2026-03-28 10:02:14 +05:30
copilot-swe-agent[bot]
efe319f755 Send synthetic left button release after drag ends to fix stale mouse state
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/e3cf07a9-b3c0-4786-b264-a83b85f098ac
2026-03-26 14:16:44 +00:00
copilot-swe-agent[bot]
215bbf68de Fix spurious mouse release event during drag out of OS window
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/f4f7b9e7-102b-4af7-aa03-4fb7a85d6ed0
2026-03-26 14:00:57 +00:00
zhaolei
e78b7b1a99 Align drag thumbnail to cursor on macOS 2026-03-24 14:42:04 +08:00
copilot-swe-agent[bot]
6b86e7db5d Extend glfwGetKeyboardRepeatDelay() to return both initial delay and repeat interval
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/bde9bf2e-a0dd-4ccd-8385-6a37be1e025f
2026-03-23 11:58:48 +00:00
copilot-swe-agent[bot]
998ee22ecb Add glfwGetKeyboardRepeatDelay() to the GLFW API for X11, Wayland and Cocoa
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/4765810b-ecf5-4348-ae3a-ff0ff481aaae
2026-03-23 11:46:35 +00:00
copilot-swe-agent[bot]
9b9bfeb02d Fix XI_BadDevice crash on USB device disconnect (#9723)
When a USB HID device (keyboard/mouse) is disconnected, X11 fires an
XI_HierarchyChanged event, which triggers read_xi_scroll_devices().
That function calls XIGetProperty() on devices from XIQueryDevice().
There is a race condition: if a device is removed between these calls,
X11 generates an XI_BadDevice error. Without a custom error handler, the
default X11 handler calls exit(), killing kitty.

Fix: wrap the device query loop in read_xi_scroll_devices() with
_glfwGrabErrorHandlerX11() / _glfwReleaseErrorHandlerX11() so that any
XI_BadDevice error is captured by kitty's own handler rather than the
default fatal one.

Fixes #9723
Fixes #9724
2026-03-22 07:52:49 +05:30
Kovid Goyal
b4005d0e97 Fix drop on clients. data should be requested only after the client actually requests it not on return from drop event callback 2026-03-21 09:06:24 +05:30
Kovid Goyal
3a30c47942 Get drop status updates working 2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
ef7b456ce7 Fix scroll valuator reset when mouse leaves window without focus change
Fixes #9716
2026-03-20 08:13:45 +05:30
Kovid Goyal
98bf76ab52 Merge branch 'master' of https://github.com/kdnk/kitty 2026-03-19 19:59:54 +05:30
Kodai Nakamura
7e62808fb7 fix: Use strict modifier check for Ctrl+H IME unmarking
Refine the check to mods == GLFW_MOD_CONTROL to ensure that
combinations like Ctrl+Shift+H do not trigger unmarkText, following
code review feedback.
2026-03-19 23:21:34 +09:00
Kodai Nakamura
2c4b6d6d8e cocoa: Unmark IME pre-edit text on Ctrl+H
This ensures that Ctrl+H behaves like Backspace and correctly clears
the pre-edit state, preventing uncommitted characters from remaining
on the screen when using IMEs like the Japanese one on macOS.
2026-03-19 23:06:09 +09:00
copilot-swe-agent[bot]
36be8be951 Fix massive scroll on focus return by resetting X11 scroll valuators on focus loss
When kitty loses focus and the user scrolls in another
application, X11 XI scroll valuators accumulate position values. When the
user returns to kitty and scrolls, delta (value - v->value) uses the stale
pre-focus-loss value, causing a massive unexpected scroll jump.

Fix: reset scroll valuators (mark them uninitialized) on FocusOut so the
first scroll event after focus is regained sets the baseline without firing
a scroll event.

Fixes #9703
Fixes #9707
2026-03-19 15:31:22 +05:30
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
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
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
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
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
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
c0b549fee8 Make XI2 scroll offset type detection more robust
Since we have to use heuristics, lets at least collect stats for a few
events before deciding.
2026-03-12 21:44:20 +05:30
Kovid Goyal
99639f1373 XInput2: Assume any fractional scroll value means the device is high res
Because as far as I can tell there is no reliable way to detect high res
scroll devices under XWayland. Sigh.
2026-03-12 20:32:15 +05:30
Kovid Goyal
5ba3d10471 X11: Fix a regression that caused some high res scroll devices to be treated as line based scroll devices
Apparently when running under XWayland, we cant rely on libinput to
detect highres scroll devices. Sigh. Linux input is such a disaster.
Dunno if this will break something else, hopefully not.

Fixes #9649
2026-03-12 19:23:41 +05:30
copilot-swe-agent[bot]
4706243380 Fix GLFW drop API to always present full original MIME type list to callbacks
Fixes #9633
2026-03-10 20:10:44 +05:30
mcrmck
59c963c481 Add draggable window title bars
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
2026-03-08 20:56:38 -04:00
Kovid Goyal
5c2b088895 Merge branch 'fix/split-view-fullscreen-crash' of https://github.com/AndrewP-GH/kitty 2026-03-01 10:59:41 +05:30
Kovid Goyal
04c35d85da Merge branch 'fix-accessibility-window-management' of https://github.com/alexasa79/kitty 2026-03-01 10:26:20 +05:30
Sasha Sandler
2c89a7dedf Allow accessibility selectors needed for external window management tools
Tools like Easy Move+Resize use the macOS Accessibility API to find and
move/resize windows. They call AXUIElementCopyElementAtPosition to get the
content view, then use kAXWindowAttribute to navigate to the parent window.

The isAccessibilitySelectorAllowed: whitelist was blocking these selectors,
preventing external window management tools (Easy Move+Resize) from working with
kitty.

Fixes #5561
2026-02-28 22:22:38 -05:00