Shake only the window in which a bell occurred, using
d.bell_window_geometry, either side to side or in random directions.
Useful for shaking the window when a shell command fails. Add docs with
shell snippets to ring the bell on command failure and demo entries.
Fire the event directly from screen_bell() instead of piggy-backing on
start_visual_bell_at in the render loop. Previously the event only fired
when visual_bell_duration was non-zero and bells in windows that were not
visible fired it late, when the window was next rendered. Now only bells
in visible windows (in the active tab and not hidden by an overlay or the
layout) fire the event.
Add the command-start, command-finish, alternate-screen-enter and
alternate-screen-exit events, which fire for changes in the active window,
and the active_window_command_running, active_window_alternate_screen,
active_window_command_state_age and active_window_alternate_screen_age
fields to KittyCustomShaderData, so shaders can show effects while
commands run and hide them in full screen programs.
animation_duration sets how long animation_progress takes to rise to one,
after which it stays there, so effects can fade in and stay on. Previously
groups with no stop duration, such as toggled ones, always had a progress
of zero.
animation_reverse makes a group play its animation in reverse when it stops,
for any reason, instead of turning off immediately. With yes it takes as
long as animation_duration, or a number of milliseconds can be given.
Stopping part way through rising reverses from the current progress and
starting again while reversing rises from there.
animation_loops, used with animation_reverse, plays the animation forwards
and in reverse again after the first reverse, without holding at one, for
effects such as blinking a few times.
Also fix attached groups not having the same animation_progress as the group
they are attached to, as documented, and explain why the per-group values
are in KittyTextures rather than KittyCustomShaderData.
Fixes#10693
Groups that are active until an event turns them off, such as those
using animation_toggle, now also move pointer events, while they are
active. The pointer map is recomputed only when the set of active such
groups changes, and pointer events are left alone once all of them have
been turned off.
Add a shader_event action that sends user:<name> events to the custom
shader pipeline, and an animation_toggle pipeline directive to turn
groups on and off with an event. User events occupy the bits above the
builtin events in a now 64 bit event mask, so firing them costs no more
than any other event and groups that are off are not drawn at all.
Fixes#10667
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().
active_window_padding only counted padding and cell-size compensation,
so the space a layout reserves for the window border (and margin) was
treated as outside the active window. With dim-inactive-windows this
left a thin dimmed strip around the active window and dimmed the active
border color.
Use render_data.geometry.spaces, which is exactly what the layout
reserved around the window. This respects layouts that do not reserve
border space in minimal border mode, so the active area never extends
into a neighboring window. Add a test that the reserved boxes of
visible windows never overlap and stay within the central area.