In this mode, the “shifted” and “base layout” keys are added to the
CSIs, as sub-parameters to the “key” parameter.
Note that this PR only implements the “shifted” key, not the “base
layout key”.
This is done by converting the original XKB symbol to it’s
corresponding UTF-32 codepoint. If this codepoint is different from
the one we use as “key” in the CSI, we add it as a sub-parameter.
Related to #319
In this mode, key events that generate text now add a third CSI
parameter, indicating the actual codepoint.
Remember that we always use the *unshifted* key in the CSI
escapes. With this mode, those CSI escapes now also included the text
codepoint. I.e. what would have been emitted, had we not generated a
CSI escape.
As far as I can tell, this mode has no effect unless “report all keys
as escape sequences” is enabled (reason being, without that, there
aren’t any text events that generate CSIs - they’re always emitted
as-is).
Note that Kitty itself seems to be somewhat buggy in this mode. At
least on Wayland, with my Swedish layout. For example ‘a’ and ‘A’ does
generate the expected CSIs, but ‘å’ and ‘Å’ appears to be treated as
non-text input.
Furthermore, Kitty optimizes away the modifier parameter, if no
modifiers are pressed (e.g. CSI 97;;97u), while we always emit the
modifier (CSI 97;1;97u).
Related to #319
Inserting elements into the URI range vector typically triggers a
vector resize. This is done using realloc(). Sometimes this causes the
vector to move, thus invalidating all existing pointers into the
vector.
OSC 4/104 changes the 256-color palette. We also run a pass over the
visible cells, and update their colors.
This was previously done by comparing the actual color of the cell,
with the “old” color in the palette. If they matched, the cell was
updated.
This meant that cells with an RGB color (i.e. not a palette based
color) was also updated, _if_ its color matched the palette color.
Now that each cell tracks its color *source*, we can ignore all
non-palette based cells.
Note that this still isn’t perfect: if the palette contains multiple
entries with the same color, we’ll end up updating the “wrong” cells.
Closes#678
Now that term_xcursor_update_for_seat() takes the current surface into
account (i.e. doesn’t assume the cursor is over the main grid),
there’s no longer any need to call render_xcursor_set() directly.
Thus, we can simply call term_xcursor_update_for_seat() on **all**
pointer enter and motion events. As long as we take care to update the
internal state to reflect the, possibly new, current surface before
doing so.
Also make sure to **always** reset the seat’s “current” xcursor
pointer on pointer leave events. This is done without actually sending
anything to the compositor, but is necessary to ensure that we *do*
send a request to update the xcursor on the next pointer enter event.
CSD borders are always *at least* 5px. If url.border-width=0, those
5px are all fully transparent (and act as interactive resize handles).
As csd.border-width increases, the number of transparent pixels
decrease. Once csd.border-width >= 5, the border is fully opaque.
When csd.border-width > 5, then width of the border is (obviously)
more than 5px. But, when rendering the opaque part of the border, we
still used 5px for the invisible part, which caused some pixman
rectangles to have negative x/y coordinates.
This resulted in rendering glitches due to overflows in pixman when
rendering the borders.
The fix is to ensure the total border size is always at least, but
not *always* 5px. That is, set it to max(5, csd.border-width).
This patch also fixes an issue where the CSD borders were not
dimmed (like the titlebar) when the window looses input focus.
Closes#823
At first, an OSC-8 URI range was added when we received the closing
OSC-8 escape (i.e. with an empty URI).
But, this meant that cursor movements while the OSC-8 escape was in
effect wasn’t handled correctly, since we’d add a range that spanned
the cursor movements.
Attempts were made to handle this in the cursor movement functions, by
closing and re-opening the URI.
However, there are too many corner cases to make this a viable
approach. Scrolling is one such example, line-wrapping another.
This patch takes a different approach; emit, or update the URI range
when we print to the grid. This models the intended behavior much more
closely, where an active OSC-8 URI act like any other SGR attribute -
it is applied to all cells printed to, but otherwise have no effect.
To avoid killing performance, this is only done in the “generic”
printer. This means OSC-8 open/close calls must now “switch” the ASCII
printer.
Note that the “fast” printer still needs to *erase* pre-existing OSC-8
URIs.
Closes#816
If a mouse selection was ongoing, and the user switched
workspace (probably using the keyboard...), and then back, the
selection was still treated as ongoing, while all other mouse state
has been reset.
This meant the user had to tap at least once to stop the selection.
The parsing context keeps a pointer to the current section name. This
is used when logging errors.
However, the pointer was into a buffer allocated by getline(). This
buffer are often re-used in the next call to getline(), or free:d.
Regardless, the section name pointer is invalid after the next call to
getline(), which meant all error messages were logging a correct
section name.
The missing return caused us to fall through to the bottom of the
function, where we ended with an error message:
[main].letter-spacing: 0: not a valid option: letter-spacing
Closes#795
This adds a new meson option that controls whether the example theme
files should be installed or not. The default is true.
Previously, themes were gated by the -Ddocs option.
This allows you to configure custom colors to be used when colors are
being dimmed (`\E[2m`).
It is implemented by color matching (just like
bold-text-in-bright=palette-based); the color-to-be-dimmed is matched
against the current color palette.
If it matches one of the regular colors (colors 0-7), the
corresponding “dim” color will be used.
If it matches one of the bright colors (colors 8-15), the
corresponding “regular” color will be used (but *only* if the “dim”
color has been set).
Otherwise, the color is dimmed by reducing its luminance.
The default behavior, i.e. when dim0-7 hasn’t been configured, is to
dim by reducing luminance for *all* colors. I.e. we don’t do any color
matching at all. In particular, this means that dimming a bright color
will *not* result in the corresponding “regular” color.
Closes#776
Similar to modifyOtherKeys=1 (foot’s default, and only, mode), except
that:
* All modifiers (and not just Ctrl) generate \E[27;m;n~ escapes
* Regular keys (with modifiers) also generate \E[27;m;n~ escapes (for
example, C-h no longer generates ^H, but \E[27;5;104~)
For our keymap based lookups, this is handled by adding
MOD_MODIFY_OTHER_KEYS_STATE<N> variants.
For “generic” keys, we simply adjust the conditions for when to emit a
\E[27;m;n~ escape - the only requirement is that at least one modifier
is active.
If there aren’t any seats available, input is not possible (neither
keyboard nor mouse input).
Note that this is not the same thing as e.g. no keyboard being plugged
in. In this case, there will be a seat, but without the keybaord
capability. Input may not be possible _right now_, but may be later,
if the user plugs in a keyboard.
Closes#779
When we’re using CSDs, we’ve up until now rendered a 5px invisible
border. This border handles interactive resizing. I.e. hovering it
changes the mouse cursor, and mouse button events are used to start an
interactive resize.
This patch makes it possible to color part of (or the entire) border,
with a configurable color.
To facilitate this, two new options have been added:
* csd.border-width
* csd.border-color
border-width defaults to 0, resulting in the look we’re used to.
border-color defaults to the title bar color. If the title bar color
hasn’t been set, it defaults to the default foreground color (just
like the title bar color does).
This means that, setting border-width but not border-color, results in
a border that blends with the title bar.
The serial is used when copying/pasting data from the clipboard. Up
until now, we’ve used the serial from the keyboard/mouse enter
events.
This works in most cases, but breaks in the following example:
$ wl-copy WLCOPY
/* Ctrl+Shift+v works fine (pastes "WLCOPY") */
$ printf "\033]52;c;eHl6\a"
/* Ctrl+Shift+v pastes "WLCOPY" instead of "xyz" */
Shifting focus away and then back to the foot window, and re-executing
the printf works, suggesting the “enter” serial is no longer valid
after another process(?) has copied something to the clipboard.
Updating the serial on key press/release (and the corresponding mouse
serial on mouse button events) seems to fix this.
I’ve also tested that “normal” copy/paste operations, within the same
foot instance, and between foot and other applications, are still
working. In at least river (wlroots based), and GNOME/mutter.
Closes#753
This fixes an issue where pasting (using e.g. OSC-52) in client
applications that doesn’t do this conversion themselves, like tmux,
doesn’t work.
Closes#752
Grapheme shaping is now enabled by default in foot. However, when
generating the profiling data in PGO builds, this results in skewed
optimizations.
The end result is worse benchmark results regardless of whether
grapheme-shaping is enabled or not (when running the benchmarks).
This changes the default value of tweak.grapheme-shaping to “yes”,
thus enabling grapheme shaping by default.
It also changes the default value of tweak.grapheme-width-method to
“wcswidth”, for maximum compatibility with terminal applications.