Key presses update the IME position, but cursor motion caused by child
output, such as the echo of committed text, did not. The next composition
then started with a stale anchor and its candidate window briefly appeared
at the old position before jumping to the cursor.
Once an IME composition has been seen, push the cursor position to the IME
whenever it changes outside a composition in the active window of the
focused OS window. Nothing extra happens until an IME is used, and there is
no timer, so no feedback loop with GNOME's done events.
Closes#10644
A large write was scheduled on two clocks. The I/O thread woke the main
loop once the previous wake was input_delay old. The parser then refused
a chunk of at least 1KB until input_delay had passed since its first
byte, and armed a timer for the rest. That first turn still painted:
repaint_delay only skips a paint when nothing was parsed and the last
paint is recent. The timer turn parsed the bytes and painted again right
away, because a turn that parsed input ignores repaint_delay. With both
delays at 1ms this was two trips, and often two paints, per large write.
input_delay 0 never holds, so it did the work once and used less CPU.
The I/O thread now asks the parser for one deadline, new_input_at +
input_delay, and sleeps until then. A chunk under 1KB still wakes
immediately, at most once per input_delay. A buffer within 16KB of full
wakes immediately, which is when the parser already refuses to hold.
If a frame callback or another event wakes the main loop while bytes are
held, render returns without painting. The hold timer is already armed.
A thumbnail still paints. A child that exits is taken off the poll set,
so the hold can no longer see it. The main thread is woken when that
child is queued and flush-parses its final output.
A signal stays latched until that wake. signalfd is emptied on the first
poll, so a later poll cannot see the same signal. Without the latch, a
signal that arrived inside the delay was dropped when the next poll had
no parser deadline.
A scanned tail left in the buffer has its timestamp cleared. Those bytes
were already looked at. They are not input waiting out input_delay.
Treating a zero timestamp as ready made every later wake skip the delay.
If monotonic() returns 0 at startup, the commit stores 1, so 0 stays the
empty timestamp and a real chunk still gets a deadline.
- Anchor the IME cursor rectangle at the column the pre-edit text is
actually drawn at, which is shifted left of the cursor when the text
would not otherwise fit on the line, instead of at the cursor column.
- Store the IBus cursor geometry cache per input context rather than in
a function static, only update it after a successful send and reset it
whenever a new input context is created.
- Add a test and a changelog entry.
Add a small Slang lexer and top level declaration parser to slang.py, and
SlangShaderQuery which runs the slangc preprocessor when an answer could
depend on it. Use it for:
- Detecting pointer_map(), so that comments, #if 0 blocks and calls no
longer count, macros are honored, and a pointer_map() that is not public
or does not return float2 is reported instead of failing obscurely. The
result is cached alongside the pipeline module, so a cached load does
not run slangc.
- Applying pipeline var directives, which now work for declarations
spanning multiple lines and match by name as documented.
- Parsing the builtin shaders, with identical results for all of them.
Also cleanup minor issues form previous PR
- Ignore pointer_map() in groups that only draw to part of the screen
- Share the pointer position conversion between glfw.c and mouse.c
- Pass POINTER_MAP_SIZE to the pipeline as a define instead of
duplicating it
- Do not free the pointer map render target on every pipeline reload
- Document what pointer_map() may depend on and when d.mouse_pos lines
up with the pointer
A shader that draws content away from where kitty put it, such as crt
curving the screen, makes clicks and selections land on the wrong cells,
since kitty maps the pointer to the unmodified cell grid. Up to several
columns near the edges with the bundled crt shader.
Shaders can now define pointer_map(pos, d), returning where the content
shown at pos actually is. kitty renders it into a 64x64 grid when the
pipeline or viewport size changes, reads it back once, and uses it to
move all pointer events. Only always active groups that draw to the
screen are used, since only they move content permanently.
The crt shader defines it, sharing its warp function with fragment_main().
Do not show subtitles by default and fix transcription errors in the
subtitle files: kitty.conf, MIME type, --hyperlink=auto, WeeChat,
switch windows, and use lowercase kitty consistently.
- Only restore entry sizes in the Splits layout resize mode was opened in;
otherwise fall back to the default reset rather than refusing to reset
- Do not take a snapshot lazily from already resized sizes when resize mode
was opened in another layout
- Running the resize kitten while its overlay is open replaces the overlay so
the new options take effect, keeping the original-size snapshot
- Newer edge statuses replace older local messages, and edge failures beep
- Switching strategy no longer discards a --fraction command-line override
- Compute divider room without deep copying the pair subtree
- Fractional resize in other layouts adopts the probed state instead of
replaying every step
- Back off on all accept() errors that leave the connection pending, not
just resource exhaustion, so the talk thread cannot spin on a readable
listener
- Use an atomic for the test only accept failure injection instead of
taking the talk mutex on every accept
- Encrypt disk cache entries in chunks of up to 1MB to reduce the number
of write syscalls for large images
- Have GlobalWatchers.set_extra() invalidate the cached watchers
English and Spanish subtitle tracks for the intro video. AI tooling was used
to sync the transcript against the video and to translate it; both tracks
were then manually proofread line by line.
The WebVTT files are shipped in docs/_static, since Sphinx copies that
directory into the output and the video itself is hosted outside the
repository.
Co-Authored-By: space-bunny-free <noreply@opencode.ai>
When growing the buffer, realloc was passed the element count instead of
the byte count, shrinking the buffer while capacity was set to the larger
value. Lines with more than 4096 codepoints (e.g. many combining chars)
would then write past the end of the allocation.
Fix dangling text pointer in buffered key events and test CSI param overflow
Key events buffered while waiting for an overlay to become ready stored
the text pointer from the GLFWkeyevent, which is only valid for the
duration of the key callback. Make the buffered events own a copy of
the text and free it in a single place.
Also add a test for the out of bounds write of is_sub_param when a
separator follows the last allowed CSI parameter.
A full screen reverse scroll (ESC M at the top, CSI T) moves every image
ref down a row. scroll_filter_func() only removed refs that left through
the top, so a cell image on the bottom line ended up at row `lines`, off
screen, while its line was discarded. The next forward scroll brought it
back onto the bottom row, where the line has no placeholders.
screen_render_line_graphics() returns early for such lines, so nothing
removed the ref and a slice of the old image was drawn over the new text.
tmux and pagers send ESC M when scrolling down, so this shows up in
practice. Fix it by dropping cell image refs that move below the bottom
margin, the same way the margins scroll path drops refs that leave the
region.
This replaces PR #10623, which was not merged for these reasons:
- It does not find the cause. It removes cell image refs at render time
for every line without placeholders, so the stale ref still exists and
is still seen by anything that reads refs before the next render, such
as graphics query and delete commands and the paused rendering path,
which returns before the new code.
- It costs time on every frame. Whenever any image is loaded, even with
no placeholders at all, each clean visible line and each visible
history line triggers a walk over all images and refs. Before, such
lines cost nothing. This fix adds one comparison to a loop that only
runs when the screen scrolls.
Close#10623
The scale between scaled and unscaled offsets was only calculated for
positive deltas, so when scrolling up or left it stayed at zero (or stale from
a previous scroll), causing momentum events to have zero offsets.
Closes#10610