Commit Graph

1480 Commits

Author SHA1 Message Date
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
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
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
Andrey Paramonov
21c2e585cf Refactor fullscreen exit handling to ensure frame constraint suppression is lifted consistently after a delay 2026-02-28 20:21:59 +03:00
Andrey Paramonov
72de57b5e5 Enhance fullscreen transition handling on macOS by adding frame constraint suppression 2026-02-28 19:59:43 +03:00
Andrey Paramonov
6d33cea816 Fix fullscreen handling for macOS Split View to prevent crashes 2026-02-28 17:56:19 +03:00
Kovid Goyal
7500c58e1c Fix #9569 2026-02-28 16:54:02 +05:30
zhaolei
31b4614c87 fix crash when macos_titlebar_color=background with transparent background 2026-02-24 18:06:53 +08:00
Kovid Goyal
5cc510dea4 Merge branch 'titlebar-only-wayland' of https://github.com/antoinecellerier/kitty 2026-02-23 19:19:30 +05:30
Kovid Goyal
1df89d9448 Cleanup previous PR
Fixes #9463
2026-02-23 07:44:58 +05:30
Kovid Goyal
1f5b11be0b Merge branch 'fix-sleep-macos' of https://github.com/jorgemmsilva/kitty 2026-02-23 07:27:58 +05:30
Kovid Goyal
f0d11f7223 ... 2026-02-22 16:48:59 +05:30
Kovid Goyal
9f2a4ad2dd Wayland: Implement ridiculous workaround for broken dnd
Wayland is *the worst* window system I have ever had the
displeasure of trying to support.
2026-02-22 16:24:46 +05:30
Kovid Goyal
322a51da98 ... 2026-02-22 15:44:28 +05:30
Kovid Goyal
b737eaad65 Cleanup previous PR
Use a single wl_surface for the drag icon. Whther it is attached to the
top level drag or not is determined based on availability.
2026-02-22 15:36:10 +05:30
copilot-swe-agent[bot]
accee908aa Implement Wayland xdg-toplevel-drag protocol for make_toplevel in _glfwPlatformChangeDragImage
Fixes #9544
2026-02-22 14:53:34 +05:30
Kovid Goyal
ca43d57cdf Fix enumeration of pasteboard items in the source 2026-02-22 13:32:55 +05:30
Kovid Goyal
531fb3e1b1 Change drag thumbnail when in detach/move modes 2026-02-22 13:09:56 +05:30
Kovid Goyal
449abb69bc Cleanup previous PR 2026-02-22 11:13:57 +05:30
copilot-swe-agent[bot]
0c0c5a62f7 Implement changing drag image in the various backends
Fixes #9542
2026-02-22 09:26:14 +05:30
Kovid Goyal
6506ce1e91 API to change image for drag in progress 2026-02-22 09:10:26 +05:30
Kovid Goyal
8ad22e7859 On Wayland detach even on drag cancel
Wayland compositors contravene their own spec and make it impossible to
distinguish between drop-but-not-accept and drag-cancel cases.
https://gitlab.freedesktop.org/wayland/wayland/-/issues/140
2026-02-22 08:19:31 +05:30
Kovid Goyal
eb23c18821 Dont detach when user presses esc to cancel drag and there is no drop 2026-02-22 07:42:42 +05:30
Kovid Goyal
0f10380773 Cocoa backend: distinguish between cancelling drop by esc key/dragging to trash and dropping in unsupported place 2026-02-22 07:34:27 +05:30
copilot-swe-agent[bot]
56a9dd1bb7 Place drag icon below cursor on macOS
Fixes #9539
2026-02-21 22:06:49 +05:30
copilot-swe-agent[bot]
bcba8fc04c Wayland: Add support for ext-background-effects
Fixes #9536
Fixes #9534
2026-02-21 20:56:40 +05:30