373 Commits

Author SHA1 Message Date
Kovid Goyal
d3c7889395 When queueing dnd data to send to the client keep space available in the queue so that inut events are not dropped while the dnd is in progress 2026-06-24 10:58:31 +05:30
David Thiel
1cc1a445e3 Fix focus_follows_mouse switching active window on desktop/space return
When focus_follows_mouse is enabled, returning to a desktop/space fired an
enter event that switched the active window to whichever one was under the
cursor, even though the mouse had not crossed a window boundary.

Distinguish genuine mouse motion into a window from a window reappearing
under a stationary cursor by checking, in cursor_enter_callback, whether the
cursor position actually changed. focus_follows_mouse now switches focus only
when the cursor moved, so motion into a window still switches focus while a
stationary reappearance does not.
2026-06-08 14:46:40 +01:00
copilot-swe-agent[bot]
973c5fb650 Implement OSC 9;4 progress bar rendering in kitty window
Fixes #9777
Fixes #9786
2026-03-31 22:45:25 +05:30
Jake Stewart
1a62cde212 Add option to generate 256 color palette from first 16 colors
Needs more work to test and possibly implement reporting and setting
of the nullable color table colors.

Fixes #9426
2026-03-27 20:01:14 +05:30
Kovid Goyal
b0e57b4dce Send drop move events to child 2026-03-21 08:41:46 +05:30
Kovid Goyal
ccc0ce5ceb Do drag resize by dragging window borders 2026-02-26 17:36:41 +05:30
Kovid Goyal
e5eb63fcd0 Refactor drag source API to be async
Wayland implementation done. Other two backends remain.
2026-02-17 13:07:55 +05:30
Kovid Goyal
cef2bac116 Fix building on old Apple systems 2026-01-01 07:41:03 +05:30
Kovid Goyal
ba3af8f2c3 Refactor GLFW scroll event callback to use a proper event struct 2025-12-31 23:40:34 +05:30
Kovid Goyal
051b0ff30d Free C locale on exit 2025-12-30 22:11:05 +05:30
Kovid Goyal
8448f737ae More comprehensive reset of color profile on screen reset 2025-12-09 08:18:36 +05:30
Kovid Goyal
80260e6eb1 Move back to individual settings for scrollbar
We need to split out the color settings so that they can be set in
themes anyway, so ...
2025-09-14 17:48:59 +05:30
Kovid Goyal
77e22523ec Start work on consolidating scrollbar settings into one option 2025-09-14 12:14:27 +05:30
Aleksey Smolenchuk
65a4d89282 Interactive scrollbar implementation 2025-09-08 11:33:15 -07:00
Kovid Goyal
14741b1b29 Implement rendering of blinking text
Fixes #8551
2025-08-25 13:55:23 +05:30
Kovid Goyal
24049a1a5a Implement round tripping of SGR blink (5/25) 2025-08-25 12:34:38 +05:30
Kovid Goyal
67763029fc Store SGR attributes in a sub struct of Cursor
Makes various operations like clearing text attributes, copying text
attributes etc. faster and less code.
2025-08-25 11:12:35 +05:30
Kovid Goyal
c393c1679e Implement rendering of multi cursors in the shaders 2025-08-24 20:14:15 +05:30
Kovid Goyal
a3465d9998 The OS Window regions should have right/bottom edges not inclusive
Currently it was a bit ambiguous some places assuming inclusive some
not. Also there seemed to be one left over pixel at the bottom/right
edges of the calculated regions compared to viewport size.This fixes
that. Hopefully doesnt break anything else, we will see.
2025-08-11 17:37:52 +05:30
Kovid Goyal
fd5876b94e Use SIMD to replace C0 control codes in Go code 2025-07-21 08:54:22 +05:30
Kovid Goyal
4d3bbd82e0 Extend the SGR Pixel mouse reporting protocol to also report when the mouse leaves the window 2025-07-12 11:59:23 +05:30
Kovid Goyal
27df509206 Nicer fix for enter event mouse tracking
Send an explicit mouse event to child when pointer enters window instead
of relying on GLFW to send a cursor position update event.
2025-03-04 11:29:29 +05:30
Kovid Goyal
756240f68d Remove unused code 2025-02-03 10:56:50 +05:30
Kovid Goyal
39dc31e021 Render the octant characters using box drawing 2025-02-03 10:56:48 +05:30
Kovid Goyal
88f796a94c Read decorations indices from a separate texture 2025-02-03 10:56:45 +05:30
Kovid Goyal
0fb49f4139 Switch to using an index for sprite tracking
Frees up two bytes in GPUCell. Doesn't require a minimum texture row
size. Makes a bunch of code faster. Index uses 31 bits which gives us
2,147,483,647 aka ~ 2 billion sprites.
2025-02-03 10:56:45 +05:30
Kovid Goyal
06f2e64cff Remove duplicated data 2025-02-03 10:56:45 +05:30
Kovid Goyal
8993386399 Store font related cell metrics in a single struct 2025-02-03 10:56:44 +05:30
Kovid Goyal
9d48fa9126 hints/unicode_input kittens: Do not lose keypresses that are sent very rapidly via an automation tool immediately after the kitten is launched
We now buffer the key events until the kitten tells us it is ready.
Without this the key presses are delivered to the underlying window
as the kitten's overlay window was not being focused until the kitten
set the ready message.

Fixes #7089
2024-12-12 13:11:12 +05:30
Johannes Altmanninger
9ab0c8575e Fix Python.h being included after system headers
My "./dev.sh build" failed with

    Compiling kitty/screen.c ...
    gcc -MMD -DNDEBUG -DPRIMARY_VERSION=4000 -DSECONDARY_VERSION=37 -DXT_VERSION="0.37.0" -I/home/johannes/git/kitty/dependencies/linux-amd64/include -Wextra -Wfloat-conversion -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11 -pedantic-errors -Werror -O3 -fwrapv -fstack-protector-strong -pipe -fvisibility=hidden -fno-plt -fPIC -D_FORTIFY_SOURCE=2 -flto -fcf-protection=full -march=native -mtune=native -pthread -I/home/johannes/git/kitty/dependencies/linux-amd64/include/libpng16 -I/home/johannes/git/kitty/dependencies/linux-amd64/include -I/home/johannes/git/kitty/dependencies/linux-amd64/include -I/home/johannes/git/kitty/dependencies/linux-amd64/include -I/home/johannes/git/kitty/dependencies/linux-amd64/include/freetype2 -I/home/johannes/git/kitty/dependencies/linux-amd64/include/libpng16 -I/usr/include/uuid -I/home/johannes/git/kitty/dependencies/linux-amd64/include/harfbuzz -I/home/johannes/git/kitty/dependencies/linux-amd64/include/freetype2 -I/home/johannes/git/kitty/dependencies/linux-amd64/include/libpng16 -I/home/johannes/git/kitty/dependencies/linux-amd64/include -I/home/johannes/git/kitty/dependencies/linux-amd64/include/python3.12 -c kitty/screen.c -o build/fast_data_types-kitty-screen.c.o
    In file included from /home/johannes/git/kitty/dependencies/linux-amd64/include/python3.12/Python.h:12,
                     from kitty/data-types.h:11,
                     from kitty/text-cache.h:10,
                     from kitty/line.h:10,
                     from kitty/history.h:10,
                     from kitty/lineops.h:9,
                     from kitty/fonts.h:9,
                     from kitty/screen.c:19:
    /home/johannes/git/kitty/dependencies/linux-amd64/include/python3.12/pyconfig.h:1875:9: error: "_POSIX_C_SOURCE" redefined
     1875 | #define _POSIX_C_SOURCE 200809L
          |         ^~~~~~~~~~~~~~~
    In file included from /usr/include/bits/libc-header-start.h:33,
                     from /usr/include/stdint.h:26,
                     from /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/include/stdint.h:9,
                     from kitty/charsets.h:9,
                     from kitty/screen.c:17:
    /usr/include/features.h:329:10: note: this is the location of the previous definition
      329 | # define _POSIX_C_SOURCE 199506L
          |          ^~~~~~~~~~~~~~~
    The following build command failed: /home/johannes/git/kitty/dependencies/linux-amd64/bin/python setup.py develop
    exit status 1

[Python docs](https://docs.python.org/3/c-api/intro.html) say:

> Since Python may define some pre-processor definitions which affect
> the standard headers on some systems, you must include Python.h
> before any standard headers are included.

Make it so. Since data-types.h is already included first in a lot of
*.c and *.h files, let's use that one.
Also fix the includes in launcher.

This is similar to commit 8e84b2145 (Re-order includes for
"_POSIX_C_SOURCE", 2018-06-02).

Also add an explicit error for this case, to make the resolution more
obvious? Here's the error when I try to include <stdlib.h> in screen.c:

    In file included from kitty/screen.c:14:
    kitty/data-types.h:11:2: error: #error "Must include \"data-types.h\" before any system headers"
       11 | #error "Must include \"data-types.h\" before any system headers"
          |  ^~~~~
    In file included from /home/johannes/git/kitty/dependencies/linux-amd64/include/python3.12/Python.h:12,
                     from kitty/data-types.h:14:
    /home/johannes/git/kitty/dependencies/linux-amd64/include/python3.12/pyconfig.h:1875:9: error: "_POSIX_C_SOURCE" redefined
     1875 | #define _POSIX_C_SOURCE 200809L
          |         ^~~~~~~~~~~~~~~
    In file included from /usr/include/bits/libc-header-start.h:33,
                     from /usr/include/stdlib.h:26,
                     from kitty/screen.c:13:
    /usr/include/features.h:329:10: note: this is the location of the previous definition
      329 | # define _POSIX_C_SOURCE 199506L
          |          ^~~~~~~~~~~~~~~
    The following build command failed: /home/johannes/git/kitty/dependencies/linux-amd64/bin/python setup.py develop
    exit status 1
2024-11-24 16:52:49 +01:00
Kovid Goyal
7ff7947ab3 Fix cell_as_unicode 2024-11-04 09:10:07 +05:30
Kovid Goyal
cabd6c0589 Initial port of code to use TextCache 2024-11-04 09:10:07 +05:30
Kovid Goyal
f6347ee1e2 Move more declarations out of data-types.h 2024-11-04 09:10:07 +05:30
Kovid Goyal
05120061cc Move various data types into their own headers 2024-11-04 09:10:07 +05:30
Kovid Goyal
c572adf677 Start work on allowing unlimited codepoints per cell
This is needed to properly support zero-width joiner based emoji
sequences.
2024-11-04 09:10:07 +05:30
Kovid Goyal
811dc814a0 Rename variable with better name
This is the time at which the cursor was moved by the client not the
time at which it was updated.
2024-10-18 11:09:29 +05:30
Rick Choi
c3eb48fc8a add cursor trail 2024-10-12 19:55:48 +09:00
Kovid Goyal
dbfeb8d6a4 Store transparent colors on ColorProfile
This will eventually allow them to be changed using remote control and
escape codes.
2024-09-24 19:02:13 +05:30
Kovid Goyal
9843b5c210 Remove unused code 2024-08-26 19:13:09 +05:30
Kovid Goyal
eedf01fbe3 Make getpeerid re-useable 2024-08-26 18:55:10 +05:30
Kovid Goyal
554a2b1811 Allow unfocused cursor shape to remain unchanged
Fixes #7728
2024-08-17 15:49:55 +05:30
Kovid Goyal
ba3de858df Mark temp vars used in min/max macros as const 2024-08-08 20:36:36 +05:30
Kovid Goyal
3d0747e713 Switch to SIMD accelerated base64 decoding for clipboard and notification requests 2024-07-26 23:57:33 +05:30
Kovid Goyal
0cf9a79760 A new option second_transparent_bg
Makes a second background color semi-transparent via background_opacity.
Useful for things like cursor line highlight in editors.

Fixes #7646
2024-07-21 20:22:31 +05:30
Kovid Goyal
0a707b5c33 Move work on animation implementation 2024-07-18 22:25:02 +05:30
Kovid Goyal
eb7487d7a2 Prepare of alpha blending of cursor
Will allow for cursor blink animation eventually.
2024-07-18 22:25:02 +05:30
Kovid Goyal
8fc96c5bd7 Make the debug logging functions consistent
They now all output the same format of:
[time since program start] msg
2024-04-08 12:53:55 +05:30
Kovid Goyal
06da31019c Micro-optimize clearing of lines
Use a doubling strategy to memset arrays to a fixed value. Makes the
memset O(log(N)) from O(N) in number of calls to memcpy.
2024-02-25 09:57:37 +05:30
Kovid Goyal
89c431a624 Optimize implementation of clear screen escape code 2024-02-25 09:57:36 +05:30
Kovid Goyal
6c2ef90033 Add some const for functions taking ColorProfile 2024-02-25 09:57:32 +05:30