Commit graph

2715 commits

Author SHA1 Message Date
Daniel Eklöf
2e7afc615c
sixel: implement reflow
Move sixel reflow from grid_reflow() to sixel_reflow(). This lets us
use internal sixel functions to update the sixels.

Note that grid_reflow() still needs to remap the sixelss coordinates.
2020-10-11 19:25:36 +02:00
Daniel Eklöf
660d6a06eb
term: update sixel rows/cols *after* cell dimension change, *before* resize
This fixes an issue where we resized+reflowed with bad rows/cols
values in the sixels.
2020-10-11 19:25:34 +02:00
Daniel Eklöf
da866f6453
sixel: verify-sixels: check for bad list order last 2020-10-11 19:25:32 +02:00
Daniel Eklöf
0876c7eafe
sixel: verify-no-wraparound-crossover: fix calculation of ‘end’ row 2020-10-11 19:25:31 +02:00
Daniel Eklöf
74c7373efc
sixel: add sixel_cell_size_changed()
This function should be called *after* the cell dimensions have
changed, but *before* resizing/reflowing the grids.
2020-10-11 19:25:29 +02:00
Daniel Eklöf
5e5036bec9
sixel: debug: more fine-grained verification of sixel image list
* Verify no sixel crosses the scrollback wrap-around
* Verify no sixels overlap
2020-10-11 19:25:27 +02:00
Daniel Eklöf
c4b84249a8
grid: reflow: re-insert sixels *after* new grid offset has been set
Also make sure to destroy sixels that are too big to fit in the scrollback.

Fixes issues with the sixel list not being sorted correctly.
2020-10-11 19:25:26 +02:00
Daniel Eklöf
368305aa59
sixel: overwrite: calculate split-up image pieces’ rows/cols from their width/height 2020-10-11 19:25:24 +02:00
Daniel Eklöf
e694f293ac
sixel: overwrite: remove asserts
Sixels may extend outside the visible screen area
2020-10-11 19:25:22 +02:00
Daniel Eklöf
9cccc76520
term: re-calculate sixel images’ rows/cols values when cell size changes 2020-10-11 19:25:20 +02:00
Daniel Eklöf
cdcdfe527c
sixel: fix sheared image when image crosses scrollback wrap-around
When a sixel image crosses the scrollback wrap-around, it is split up
into (at least) two pieces.

We use cursor->point.col for all pieces’ x-coordinate. This caused the
final image to appear sheared, since we do a carriage-return (after a
number of linefeeds) after each piece - this causes the cursor’s
position to be reset to the left margin.

The solution is simple; remember the cursor’s initial x-coordinate,
and use that to position all image pieces.

Closes #151.
2020-10-11 19:25:18 +02:00
Daniel Eklöf
7a7ba599c3
sixel: overwrite-by-rectangle expects ‘width’ to not exceed screen
This fixes a crash when the emitted sixel extends beyond the right
margin. The crash only happens when there are other sixel images
already emitted.

Fixes part of #151
2020-10-11 19:25:16 +02:00
Daniel Eklöf
2c515c27e5
sixel: fold long line 2020-10-11 19:25:14 +02:00
Daniel Eklöf
ab618dd192
doc: foot.1: remove ‘--’ from example command line 2020-10-11 19:25:07 +02:00
Daniel Eklöf
9de744ae39
doc: foot.ini: mention that ‘lines’ is rounded up to nearest power of 2 2020-10-11 19:25:06 +02:00
Daniel Eklöf
8257954bfa
doc: foot.ini: “top at” -> “top of” 2020-10-11 19:25:01 +02:00
Daniel Eklöf
6714c3343f
doc: foot.ini: it’s foot.ini, not foot.init 2020-10-11 19:24:56 +02:00
Daniel Eklöf
a53e8c2866
render: apply opacity correctly when in reverse video mode 2020-10-11 19:24:50 +02:00
Daniel Eklöf
5aa170b9f6
doc: foot.ini: the tweak section is called ‘tweak’, not ‘tweaks’ 2020-10-11 19:24:13 +02:00
Daniel Eklöf
852fc049c8
config: ignore key/value pairs following an invalid section name
When we detected an invalid section name, we correctly logged this and
warned the user.

However, the internal state machine now had an invalid section enum
value. This caused a crash when the next key/value pair was to be
parsed and we tried to lookup which parser function to call.

Closes #159.
2020-10-11 19:24:08 +02:00
Daniel Eklöf
3c057fb600
changelog: trackpad scrolling: ‘multiplier’ is in the ‘scrollback’ section 2020-10-11 19:23:35 +02:00
Daniel Eklöf
aa3fcc1251
changelog: multiplier: the option belongs to the ‘scrollback’ section 2020-10-11 19:23:33 +02:00
Daniel Eklöf
8181113e3c
changelog: multiplier default value changed from 1.0 -> 3.0 2020-10-11 19:23:31 +02:00
Daniel Eklöf
bf17026ed7
config: change default multiplier from 1.0 -> 3.0 2020-10-11 19:23:29 +02:00
Daniel Eklöf
1bc9c1c230
changelog: reword trackpad scrolling speed entry 2020-10-11 19:23:27 +02:00
Daniel Eklöf
8e04b08615
input: trackpad scroll: correctly convert pixel movements to line movements
Trackpad scroll movements are in pixels. Foot previously “translated”
these directly to line movements (i.e. a one pixel scroll event was
translated into a one line scroll).

Now we use the line height of the terminal and correctly convert
pixels to lines.

This makes the trackpad scroll speed in foot consistent with the
scroll speed in e.g. Alacritty and Kitty.
2020-10-11 19:23:25 +02:00
Daniel Eklöf
661fa98cb2
grid: reflow: fix release build; ‘idx’ is only used in an assert() 2020-10-11 19:23:12 +02:00
Daniel Eklöf
0e9eea85af
grid: reflow: handle viewport being too far down when enlarging the window
If the viewport is close to the bottom, but not *at* the bottom, and
we’re enlarging the window, the translated viewport will be too far
down.
2020-10-11 19:23:11 +02:00
Daniel Eklöf
b12ce3d7d7
grid: reflow: retain scrollback position
Closes #142
2020-10-11 19:23:09 +02:00
Daniel Eklöf
acd1d6a4a3
changelog: fixed color flashes with OSC 4,10,11 2020-10-11 19:23:06 +02:00
Daniel Eklöf
af2873987f
render: remove render_refresh_margins() 2020-10-11 19:23:04 +02:00
Daniel Eklöf
5924892bbe
osc: don’t explicitly call render_refresh() when changing the color palette
Doing so will schedule the renderer “as soon as possible”. I.e we’re
by-passing the regular scheduler, and thus we’re by-passing the user’s
setting of the delayed-render-* timers.

The fact that we’re scheduling “as soon as possible” also means we’re
much more likely to trigger flickering, or color flashes, if the
application is changing colors which are on the screen.

To handle changes to the cursor color(s), use the new
term_damage_cursor() instead of render_refresh().

To handle background color changes, which affect the margins, use the
new term_damage_margins() instead of render_refresh_margins(),

Closes #141
2020-10-11 19:23:02 +02:00
Daniel Eklöf
97f20b4dd6
render: term->render.margins is used to explicitly tell us to re-render margins 2020-10-11 19:23:00 +02:00
Daniel Eklöf
0caa9c4173
term: add term_damage_cursor() and term_damage_margins()
term_damage_cursor() damages the cell where the cursor is currently
at. This can be used to ensure the cursor is re-drawn, if there aren’t
any other pending updates.

term_damage_margins() requests the margins be redrawn the next time we
render the grid.
2020-10-11 19:22:58 +02:00
Daniel Eklöf
59ca98f989
input: mouse: match binding if binding’s click count is *less*
Allow a mouse binding to match even if its click count is less than
the actual click count.

If there are multiple bindings that match, use the one with the
highest click count (that less than, or equal to the actual click
count).

Closes #146
2020-10-11 19:22:47 +02:00
Daniel Eklöf
585fd7ad1f
install: say _why_ ncurses and scdoc is needed 2020-10-11 19:22:30 +02:00
Daniel Eklöf
7bb756ccbc
changelog: add new ‘unreleased’ section 2020-10-11 19:22:21 +02:00
Daniel Eklöf
bfe3dfaf5c
meson/pkgbuild: bump version to 1.5.0 2020-09-18 21:23:27 +02:00
Daniel Eklöf
377a721b08
changelog: prepare for 1.5.0 2020-09-18 21:22:59 +02:00
Daniel Eklöf
70cf0966a5
changelog: add cherti to contributors 2020-09-18 21:22:27 +02:00
Daniel Eklöf
c244ff522e
Revert "changelog: add cherti to contributors"
This reverts commit 8f3692f9a6.
2020-09-18 21:22:10 +02:00
Daniel Eklöf
8f3692f9a6
changelog: add cherti to contributors 2020-09-18 21:20:12 +02:00
Daniel Eklöf
8dd358a8f4
meson/pkgbuild: bump fcft requirement to 2.3.0 2020-09-18 21:03:40 +02:00
Daniel Eklöf
fcb2beebda
selection: reset clipboard/primary->text after free:ing it 2020-09-17 20:05:22 +02:00
Daniel Eklöf
dd18710bb7
selection: primary unset: don’t free text twice 2020-09-17 20:02:38 +02:00
Daniel Eklöf
2e7102c956
render: fix rounding errors when setting initial window size and scale != 1
An odd cell width/height sometimes resulted in an odd grid
size. Combined with a scaling factor of e.g. 2, that led to a rounding
error when converting pixel sizes to logical window sizes.

As a result, the _next_ configure event would cause us to loose a
pixel, which led to us dropping a row from the grid.
2020-09-17 17:37:58 +02:00
Daniel Eklöf
185a6048a7
ci: fix path to junit report on release builds 2020-09-16 19:41:53 +02:00
Daniel Eklöf
0f0fec093e
ci: install fonts, needed for fcft tests 2020-09-16 19:38:50 +02:00
Daniel Eklöf
bcbf9872ec
ci: need the ‘dev’ version of ‘check’ on alpine 2020-09-16 19:29:46 +02:00
Daniel Eklöf
187b913050
ci: install ‘check’ - this enables fcft tests 2020-09-16 19:27:20 +02:00