Commit graph

6248 commits

Author SHA1 Message Date
Daniel Eklöf
963ce45f3f
render: resize: copy styled underlines to temporary grid
When doing an interactive resize, we create a small grid copy of the
current viewport, and then do a non-reflow resize.

When the interactive resize is done, we do a proper reflow. This is
for performance reasons.

When creating the viewport copy, we also need to copy the styled
underlines. Otherwise, styled underlines will be rendered as plain
underlines *while resizing*.
2024-06-26 18:39:23 +02:00
Daniel Eklöf
b20302c2a7
grid: reflow: handle styled underlines 2024-06-26 18:39:23 +02:00
Daniel Eklöf
8e2402605e
render: styled underlines
This was originally contributed by @kraftwerk28 in
https://codeberg.org/dnkl/foot/pulls/1099

Here, we re-use the rendering logic only, as attribute tracking has
been completely rewritten.
2024-06-26 18:39:23 +02:00
Daniel Eklöf
a45ccfaed0
csi: remove debug log 2024-06-26 18:39:23 +02:00
Daniel Eklöf
05f9774416
foot.info: add smulx (styled underlines) 2024-06-26 18:39:23 +02:00
Daniel Eklöf
32effc6657
csi: wip: styled underlines
This is work in progress, and fairly untested.

This adds initial tracking of styled underlines. Setting attributes
seems to work (both color and underline style). Grid reflow has *not*
been tested.

When rendering, style is currently ignored (all styles are rendered as
a plain, legacy underline).

Color however, *is* applied.
2024-06-26 18:39:23 +02:00
Daniel Eklöf
20923bb2e8
grid: refactor: first step towards a more generic range handling 2024-06-26 18:39:23 +02:00
Daniel Eklöf
cbe399ecd9
Merge branch 'vs15-16'
Closes #1742
2024-06-26 18:38:47 +02:00
Daniel Eklöf
085c60a334
scripts: generate-emoji-variation-sequences: don't assume single codepoint sequences
Right now (Unicode 15.1), all valid variation sequences consist of a
single Unicode codepoint (followed by either VS-15 or VS-16).

Don't assume this is the case.

We don't actually handle longer sequences. But now we at least catch
such escapes, and error out.
2024-06-26 18:33:23 +02:00
Daniel Eklöf
aed9c392eb
scripts: generate-emoji-variation-sequences: compact the C struct
Lookups in this table is not performance critical at all.

Thus, let's compact it to bring down the binary size of foot.

This brings the size of each entry down from 9 bytes to 6, bringing
the size of the whole thing down from 1647 bytes to 1098 bytes, saving
us 549 bytes.
2024-06-26 18:32:10 +02:00
Daniel Eklöf
7378ecf9a7
vt: unittest: verify emoji_vs list is sorted 2024-06-25 08:23:40 +02:00
Daniel Eklöf
ecb1ca61af
scripts: generate-emoji-variation-sequences: don't assume input is sorted 2024-06-25 08:23:27 +02:00
Daniel Eklöf
9665661445
vt: only apply VS-15/16 to valid sequences
At compile time, build a lookup table from the Unicode data file
'emoji-variation-sequences.txt'.

At run-time, when we detect a VS-15/16 sequence, do a lookup in this
table, and enforce the variation selector iff the sequence is valid.

Closes #1742
2024-06-25 08:20:21 +02:00
Daniel Eklöf
94583703e1
vt: don't ignore VS-15 (text presentation)
When we encounter either VS-15 or VS-16, set the grapheme width to 1
or 2 explicitly.
2024-06-25 08:20:20 +02:00
Daniel Eklöf
519e9b8b5e
doc: foot.ini: fix typos 2024-06-25 08:20:03 +02:00
Daniel Eklöf
911af53c5c
doc: foot.ini: document issues with fractional scaling and initial-window-size-*
Since most compositors don't report the correct scaling factor
until *after* the window has been mapped, these options often do not
work.
2024-06-25 08:12:40 +02:00
Daniel Eklöf
795e39de1a
shm: discard shm buffers with mis-matching alpha-setting 2024-06-24 20:09:37 +02:00
Daniel Eklöf
c45231ef89
input: don't reset the XKB compose state in keymap()
When the compositor sends a new keymap, don't reset the XKB compose
state.

This is done by initializing the XKB context, along with the compose
state, when binding the seat, instead of in keymap().

Then, in keymap(), simply stop destroying the old xkb state. Only
destroy, and re-create the keymap state.

Closes #1744
2024-06-22 08:00:13 +02:00
Daniel Eklöf
aea16ba5d2
input: implement wl_pointer::axis_value120()
This implements high resolution mouse wheel scroll events. A "normal"
scroll step corresponds to the value 120. Anything less than that is a
partial scroll step.

This event replaces axis_discrete(), when we bind wl_seat v8 (which we
now do, when available).

We calculate the number of degrees that is required to scroll a single
line, based off of the scrollback.multiplier value.

Each high-res event accumulates, until we have at least the number of
degress required to scroll one, or more lines.

The remaining degrees are kept, and added to in the next scroll event.

Closes #1738
2024-06-18 14:09:03 +02:00
Daniel Eklöf
f3d848da01
osc: 52: treat OSC-52 replies as paste data (after all, they are)
This fixes an issue where other data (such as replies to other
requests) being interleaved with the OSC-52 reply.

The patch piggy backs on the already existing mechanism for handling
regular pastes, where other data is queued up until the paste is done.

There's one corner case that won't work; if the user *just* did a
normal paste (i.e. at virtually the same time the application
requested OSC-52 data), the OSC-52 request will return an empty reply.

Likewise, if there are multiple OSC-52 requests at the same time, only
the first will return data.

Closes #1734
2024-06-09 10:14:57 +02:00
Daniel Eklöf
4bb68282be
foot.ini: add missing option resize-by-cells
Closes #1731
2024-06-08 08:54:12 +02:00
Daniel Eklöf
0755aa7e83
config: codespell: varios -> various 2024-06-08 08:49:43 +02:00
Daniel Eklöf
ba424e8494
ime: codespell: surroundin -> surrounding 2024-06-08 08:49:33 +02:00
Daniel Eklöf
1b4f97d263
issue-template: let's see if we can disable the default template 2024-06-08 08:21:55 +02:00
Jan Beich
f67449700b
meson: auto-detect execvpe on FreeBSD
0667d0e0e3
2024-06-07 16:31:11 +02:00
Daniel Eklöf
bb2e0d64e1
doc: foot.ini: document pixelsize
People are apparently too lazy to read fontconfig's documentation, and
don't understand how to configure font sizes in foot.
2024-06-07 16:18:28 +02:00
Daniel Eklöf
0bf5a7e902
sixel: comment: document the P1 parameter
(and no, it's no longer unimplemented)
2024-05-22 14:56:10 +02:00
Daniel Eklöf
91561d7ba7
issue-template: link "debug build", not just "build" 2024-05-22 14:47:57 +02:00
Daniel Eklöf
5a4af31d18
issue-template: formatting; hopefully makes it easier to read 2024-05-22 14:47:07 +02:00
Daniel Eklöf
585fac7af0
issue-template: ask user to provide info on tmux, zellij, IMEs etc 2024-05-22 14:44:16 +02:00
Daniel Eklöf
713d8d59fb
issue-template: add input-field for TERM 2024-05-22 14:43:51 +02:00
Daniel Eklöf
f64cc04fe6
shm: minor optimization
Don't retry memfd_create() without MFD_NOEXEC_SEAL is 0.

The overall logic is this:

* Try memfd_create() with MFD_NOEXEC_SEAL
* If that fails (which it does, on older kernels), try without the flag

If compiling against an older kernel, or on a system that doesn't
support the noexec seal, MFD_NOEXEC_SEAL is 0.

In this case, there's little point in retrying memfd_create a second
time, with the exact same set of flags.
2024-05-22 14:06:15 +02:00
Daniel Eklöf
fb2ad83d79
changelog: wp-single-pixel-buffer-v1 2024-05-22 13:48:47 +02:00
Daniel Eklöf
708ca3d650
render: single-pixel: minor optimization
Don't re-create the single-pixel buffer, unless necessary.

The buffer itself doesn't have a size. That means we can re-use the
buffer if the last frame's overlay style matches the current frame's
style.

What we *do not* know is whether the current frame's size is the same
as the last frame's.

This means we still have to set the viewport destination, and commit
the surface.
2024-05-22 13:48:46 +02:00
Daniel Eklöf
3c96d0b68e
render: use single-pixel buffers for overlays, when possible
The unicode-mode, and flash overlays are single color buffers. This
means we can use the single-pixel buffer protocol.

It's undefined whether the compositor will release the buffer or not;
to make things easier, simply destroy the buffer as soon as we've
committed it.

Note that since compositors don't necessarily release single-pixel
buffers, we can't plug them into our own buffer interface. This means
we can't use buffer pointers to check if we can re-use the previous
buffer (i.e. we can skip comitting a new buffer), or if we have to
create a new one.

It's _almost_ enough to just check if the last overlay style is the
same as the current one. Except that that doesn't take window resizes
into account...
2024-05-22 13:48:46 +02:00
Craig Barnes
6944d5f901 issue-template: fix typo 2024-05-21 17:48:04 +01:00
Daniel Eklöf
8716ca5784
url-mode: disable IME mode while URL-mode is active
This prevents the IME from stealing "our" key-presses, and thus
preventing the user from opening URLs.

Closes #1718, hopefully.
2024-05-21 08:37:39 +02:00
Daniel Eklöf
18b702b249
unicode-mode: move state from seat to term
This fixes an issue where entering unicode-mode in one foot client,
also enabled unicode-mode on other foot clients. Both
visually (although glitchy), and in effect.

The reason the state was originally in the seat objects, was to fully
support multi-seat. That is, one seat/keyboard entering unicode-mode
should not affect other seats/keyboards.

The issue with this is that seat objects are Wayland global. Thus, in
server mode, all seat objects are shared between the foot clients.

There is a similarity with IME, which also keeps state in the
seat. There's one big difference, however, and that is IME has Wayland
native enter/leave events, that the compositor emits when windows are
focused/unfocused. These events allow us to reset IME state. For our
own Unicode mode, there is nothing similar.

This patch moves the Unicode state from seats, to the terminal
struct. This does mean that if one seat/keyboard enters Unicode mode,
then *all* seats/keyboards will affect the unicode state. This
potential downside is outweighed by the fact that different foot
clients no longer affect each other.

Closes #1717
2024-05-21 08:36:56 +02:00
Daniel Eklöf
cf65ad49e8
issue-template: feature: use yaml instead 2024-05-21 08:31:08 +02:00
Daniel Eklöf
7982433c71
issue-template: try to add another template, for feature requests. 2024-05-21 08:27:24 +02:00
Daniel Eklöf
ad7e0f7f32
issue-template: it's validation*s* 2024-05-21 08:18:28 +02:00
Daniel Eklöf
dffe2e0b7c
issue-template: try to fix link to INSTALL.md, attempt 3 2024-05-21 08:14:58 +02:00
Daniel Eklöf
5b0eb7b42d
issue-template: try to fix link to INSTALL.md, attempt 2 2024-05-21 08:14:15 +02:00
Daniel Eklöf
14b84dd7c5
issue-template: try to fix link to INSTALL.md 2024-05-21 08:13:11 +02:00
Daniel Eklöf
26e22b74b1
forgejo: issue report templates 2024-05-21 08:11:39 +02:00
Daniel Eklöf
7b983be3d8
foot.ini: add commented out 'blink-rate' 2024-05-20 11:00:02 +02:00
Daniel Eklöf
c4f1380943
config: add cursor.blink-rate option
The default is 500ms, which corresponds to the old, hardcoded default.

Closes #1707
2024-05-20 09:17:42 +02:00
Mariusz Bialonczyk
bc193c7be5 themes: add onehalf-dark 2024-05-17 10:56:20 +02:00
Artturin
3a7ea1f44b scripts: generate-builtin-terminfo: fix syntax error 2024-05-01 21:18:41 +03:00
Daniel Eklöf
3c4669061b
scripts: generate-builtin-terminfo: use \xNN for control characters
Instead of emitting raw control characters (for e.g. bel, cub1 and
kbs), use \xNN C string escapes.
2024-04-30 10:50:31 +02:00