Commit graph

4197 commits

Author SHA1 Message Date
Craig Barnes
e4ff8d83d1 vt: make anywhere() function return term->vt.state by default
Instead of passing a `default_return` parameter, which is always
just the current state anyway.
2021-05-13 07:47:32 +01:00
Craig Barnes
8bb69f22b7 vt: clean up handling of "anywhere" actions 2021-05-13 07:47:26 +01:00
Daniel Eklöf
4ed545f4d8
Merge branch 'no-underlines-below-cell'
Closes #503
2021-05-12 20:10:58 +02:00
Daniel Eklöf
2ac8509c82
render: force underlines to be visible
In some cases, the underline position (typically provided by the font,
mind you), end up below the cell, making it visible.

Note that below the cell here means below the line. I.e. the font
provided underline position is below the font provided line height...

Oh well.

Doing this in foot rather than fcft, since other applications
typically don’t have to clip the rendered text.

Closes #503
2021-05-12 20:10:04 +02:00
Daniel Eklöf
9b5330bf29
Merge branch 'remove-plasma-quirk' 2021-05-12 20:08:56 +02:00
Daniel Eklöf
29776dbd1f
quirk: remove plasma/kwin quirk
Older version of Plasma/KWin had an issue where buffer damage recorded
before the buffer was attached were ignored. This appears to have been
fixed now.
2021-05-12 20:08:40 +02:00
Daniel Eklöf
04215bac6c
Merge branch 'double-buffering'
Closes #478
2021-05-12 20:07:40 +02:00
Daniel Eklöf
07d0acbabf
changelog: improved performance when double buffering 2021-05-12 20:07:18 +02:00
Daniel Eklöf
dc4f60fd4f
render: always do a full repaint if last buffer’s dimension doesn’t match 2021-05-12 20:06:15 +02:00
Daniel Eklöf
51dec651f4
render: add margins to buffer’s dirty region when rendering margins 2021-05-12 20:06:15 +02:00
Daniel Eklöf
945a346596
shm: clear buffer’s dirty region before returning a cached buffer
A non-busy buffer should always have an empty dirty region
2021-05-12 20:06:15 +02:00
Daniel Eklöf
37bbf44f6d
shm: set ‘age’ in newly allocated buffers to something large
This ensures we don’t try to do a partial update of fresh buffer.
2021-05-12 20:06:15 +02:00
Daniel Eklöf
0433ba8477
shm: free scroll damage before returning cached buffer 2021-05-12 20:06:15 +02:00
Daniel Eklöf
9b339a35f0
render: warn if we’re forced to double buffer at least 5 times 2021-05-12 20:06:15 +02:00
Daniel Eklöf
34becf0df0
render: code cleanup, log double buffering time
* Break out cursor cell dirtying to separate functions
* Break out handling of double buffering
* Handle buffers with age > 1 (we’re swapping between more than 2
  buffers)
* Detect full screen repaints, and skip re-applying old frame’s damage
* Use an allocated array insted of a tll list for old frame’s scroll damage
* When logging frame rendering time, including the amount used for
  double buffering.
2021-05-12 20:06:15 +02:00
Daniel Eklöf
a1d2044d75
render: subtract current frame’s damage when there’s no scroll damage
When re-applying the previous frame’s damage (due to us being forced
to double buffer), subtract the current frame’s damage from the
region-to-copy when there’s no scroll damage on the current frame.

When the current frame doesn’t have any scroll damage, the current
frame’s damage is in the same coordinate system as the previous
frame’s damage, and we can safely remove it from the region we copy
from.
2021-05-12 20:06:15 +02:00
Daniel Eklöf
15bfeea745
render: wip: re-apply last frame’s damage when forced to double buffer
When we are forced to swap between two buffers, re-apply the old
frame’s damage to the current buffer, before applying the current
frame’s damage.

First, while applying this frame’s scroll damage, copy it to the
buffer’s scroll damage list (so that we can access it via
term->render.last_buf).

Also, when iterating and rendering the grid, build a pixman region of
the damaged regions. This is currently done on a per-row basis. This
is also stored in the buffer.

Now, when being forced to double buffer, first iterate the old
buffer’s damage, and re-apply it to the current buffer. Then,
composite the old buffer on top of the current buffer, using the old
frame’s damage region as clip region. This effectively copies
everything that was rendered to the last frame. Remember, this is on a
per-row basis.

Then we go on and render the frame as usual.

Note that it would be _really_ nice if we could subtract the current
frame’s damage region from the clip region (no point in copying areas
we’re going to overwrite anyway). Unfortunately, that’s harder than it
looks; the current frame’s damage region is only valid *after* this
frame’s scroll damage have been applied, while the last frame’s damage
region is only valid *before* it’s been applied.

Translating one to the other isn’t easy, since scroll damage isn’t
just about counting lines - there may be multiple scroll damage
records, each with its own scrolling region. This creates very complex
scenarios.
2021-05-12 20:06:15 +02:00
Daniel Eklöf
434c9c3a34
shm: add damage tracking to buffer 2021-05-12 20:06:15 +02:00
Daniel Eklöf
c8b342ae51
shm: track busy buffers’ age, and add compile-time option to force double buffering
By default, age all matching buffers that are busy (i.e. in use by the
compositor).

This allows us to detect whether we can apply the current frame’s
damage directly, or if we need to prepare the buffer first (e.g. copy
old buffer, or re-apply last frame’s damage etc).
2021-05-12 20:06:04 +02:00
Daniel Eklöf
1501d36470
wayland: codespell: pre-empt -> preempt 2021-05-11 08:02:46 +02:00
Daniel Eklöf
2e8bea0a5d
wayland: add comment describing the configure preempt workaround 2021-05-10 17:57:14 +02:00
Daniel Eklöf
f930de65ef
Merge branch 'sixel-assertion'
Closes #494
2021-05-08 20:30:21 +02:00
Daniel Eklöf
aada44bc7e
changelog: sixel assertion hit when a sixel fills the scrollback 2021-05-08 20:29:35 +02:00
Daniel Eklöf
ba451af5c7
sixel: don’t emit sixels that will end up covering more than the entire scrollback
This limit can be reached by the sixel alone, or the sixel + the final
newline.

Closes #494
2021-05-08 20:28:16 +02:00
Daniel Eklöf
9bd14c0fd2
sixel: fix assertion: image is allowed to cover the entire scrollback 2021-05-08 20:28:16 +02:00
Daniel Eklöf
2f01ecbadb
Merge branch 'osc8-mem-leak'
Closes #495
2021-05-08 20:27:46 +02:00
Daniel Eklöf
f3b3bc1f71
term: reset: combine memset+initializers of vt struct 2021-05-08 20:27:20 +02:00
Daniel Eklöf
bfd3eb47ec
term: reset: fix reset of the VT struct
1. Free buffers and strings
2. memset() the vt struct
3. re-initialize members that must not be zero

We _could_ replace the memset() with explicit zeroing of all the
members. It’s just that there’s a lot of arrays, so this is much
easier.

Closes #495
2021-05-08 20:27:20 +02:00
Daniel Eklöf
bd8c936b00
term: osc8-open: assert URI in VT struct is NULL 2021-05-08 20:27:12 +02:00
Craig Barnes
758a36dac1 Merge branch 'simplify-parse_section_colors' 2021-05-08 18:30:56 +01:00
Craig Barnes
db4b206409 config: simplify parsing of "scaling-filter" values slightly 2021-05-08 16:50:49 +01:00
Craig Barnes
9c8c99c9e0 config: simplify parse_section_colors() 2021-05-08 14:56:11 +01:00
Daniel Eklöf
df6c6f5bd6
Merge branch 'config-code-size' 2021-05-08 13:58:25 +02:00
Daniel Eklöf
31f7479065
Merge branch 'color-table-config'
Closes #489
2021-05-08 13:54:14 +02:00
Ryan Farley
3b089b4203 configure full color palette in foot.ini
Allow the use of numeric keys in [colors] to configure the full set of
256 colors in the palette. Fixes #489
2021-05-08 06:40:00 -05:00
Daniel Eklöf
ba2c3606bf
config: avoid tll() code expansion when generating default bindings
tll_push_back() is a macro that results in quite a lot of
instructions. Expanding this macro explicitly in many places thus
causes code explosion.

This is what happened in when we generate the default key/mouse
bindings.

Fix by calling tll_push_back() in a no-inline function.

Reduces code size with ~4-5K
2021-05-07 17:21:18 +02:00
Daniel Eklöf
449ac7c361
config: don’t inline str_to_*() functions 2021-05-07 17:18:27 +02:00
Daniel Eklöf
0b97740bd0
config: implement LOG_AND_NOTIFY_* macros in terms of no-inline functions
Reduces code size by quite a lot:

From:

    section               size   addr
    .text                37857      0
    ...
    Total                45169

To:

    section               size   addr
    .text                31681      0
    ...
    Total                38993

LTO release build goes from 500K -> 492K
2021-05-07 16:52:56 +02:00
Daniel Eklöf
7af475098b
xmalloc: export xvasprintf() 2021-05-07 16:52:56 +02:00
Daniel Eklöf
cda55d7de4
log: add va_list versions of log_* functions 2021-05-07 16:52:56 +02:00
Daniel Eklöf
63572e4223
Merge branch 'bell-enhancement' 2021-05-07 16:47:53 +02:00
Ryan Farley
5df981d23f consistent booleans in config, reset legacy bell 2021-05-07 07:16:48 -05:00
Ryan Farley
4c73172ce5 update changelog 2021-05-07 04:49:34 -05:00
Daniel Eklöf
c51f35abb9
Merge branch 'bump-fcft-to-2-4-0' 2021-05-07 11:47:33 +02:00
Ryan Farley
b3117f75d8 clearly mark bell as a section 2021-05-07 04:41:50 -05:00
Ryan Farley
dc9751cbfe style, consistent bool names, deprecate old config 2021-05-07 04:40:07 -05:00
Daniel Eklöf
96ae2d2bd7
meson: require fcft >= 2.4 2021-05-07 11:31:33 +02:00
Ryan Farley
5d71ccc174 enhanced bell configuration
Add a separate section for bell configuration, with a bell-specific
command option and a setting to allow that command to run without regard
to keyboard focus (for those of us who enjoy being beeped at at all
times, for example). The actions are also no longer mutually exclusive;
this is primarily anticipating urgency support which cannot be
replicated outside the process (in server mode anyway) and would thus be
complementary to any notification or arbitrary command.
2021-05-07 03:12:27 -05:00
Daniel Eklöf
8cb95018c0
Merge branch 'fix-color-cube'
Closes #479
2021-05-06 14:06:43 +02:00
Daniel Eklöf
a720188b42
config: fix color cube generation
Closes #479
2021-05-06 12:39:30 +02:00