Commit graph

2984 commits

Author SHA1 Message Date
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
c938d9f614
changelog: remove duplicate entry 2020-10-11 19:20:24 +02:00
Daniel Eklöf
7b11c27570
changelog: move ‘csd.preferred=none’ from ‘changed’ to ‘added’ 2020-10-11 19:04:21 +02:00
Daniel Eklöf
6afe64b7f4
wayland: don’t instantiate a decoration object when user disabled decorations
An application opts *in* for being compositor-decorated by
instantiating a decoration object.

This means, even if we request e.g. CSDs, the compositor can choose to
use SSDs.

By *not* instantiating a decorator object, the compositor *must* not
decorate the window for us.

So, when the user has set csd.preferred=none, we absolute do not want
the compositor to decorate us. Thus, we refrain from instantiating a
decoration object.
2020-10-11 18:47:26 +02:00
Daniel Eklöf
0d8344d3b9
selection: auto-scroll: call cmd_scrollback_{up,down}() with number of rows
No need to loop and call cmd_scrollback_{up,down}() with ‘1’ each loop
iteration; just call it with the total number of lines to scroll.
2020-10-11 18:26:24 +02:00
Daniel Eklöf
0cff7c7c4f
selection: cancel: call selection_stop_scroll_timer()
Instead of re-implementing the same logic, simply call
selection_stop_scroll_timer().
2020-10-11 18:24:47 +02:00
Daniel Eklöf
674e565b5a
input: comment: ‘measures’ -> ‘measured’ 2020-10-11 18:23:16 +02:00
Daniel Eklöf
0f67549e04
input: comment: ‘fast’ -> ‘faster’ 2020-10-11 18:22:29 +02:00
Daniel Eklöf
2203422d8a
changelog: auto-scroll while selecting 2020-10-11 18:19:38 +02:00
Daniel Eklöf
4ad7fdc19c
selection: auto-scroll: add SELECTION_SCROLL_NOT as a scroll ‘direction’ 2020-10-11 18:18:18 +02:00
Daniel Eklöf
dd14e0b3c3
input: auto-scroll: apply scrollback.multiplier to the interval divisor 2020-10-11 18:09:30 +02:00
Daniel Eklöf
17761dce63
csi: implement ‘CSI ? 1042 h/l’ - enable/disable bell-is-urgent 2020-10-11 17:44:29 +02:00
Daniel Eklöf
7fedf2f801
selection: auto-scroll: selection keeps scrolling while mouse is outside grid
Moving the mouse outside the grid while we have an on-going selection
now starts a timer. The interval of this timer depends on the mouse’s
distance from the grid - the further away the mouse is, the shorter
interval.

On each timer timeout, we scroll one line, and update the
selection. Thus, the shorter the interval, the faster we scroll.

The timer is canceled as soon as the mouse enters the grid again, or
the selection is either canceled or finalized.

The timer FD is created and destroyed on-demand.

Most of the logic is now in selection.c. The exception is the
calculation of the timer interval, which depends on the mouse’s
position. Thus, this is done in input.c.

The scroll+selection update logic needs to know a) which direction
we’re scrolling in, and b) which *column* the selection should be
updated with.

If the mouse is outside the grid’s left or right margins, the stored
mouse column will be -1. I.e. we don’t know whether the mouse is on
the left or right side of the grid. This is why the caller, that
starts the timer, must provide this value.

The same applies to top and bottom margins, but since we already have
the scroll *direction*, which row value to use can be derived from this.
2020-10-11 15:44:20 +02:00
Daniel Eklöf
2303affc87
input: motion: scroll up/down while selecting
If the cursor moves above the grid top, or below the grid bottom,
while selecting text, scroll up/down the scrollback before updating
the selection.

TODO: this only scrolls when the mouse is *moved*. I.e. you can’t move
the cursor outside the grid once and for all, and then let foot
auto-scroll.
2020-10-11 12:03:20 +02:00
Daniel Eklöf
c650862b0d
readme/doc: add shift+insert to list of default key bindings 2020-10-10 23:36:41 +02:00
Daniel Eklöf
d7147db0fb
changelog: update ‘contributors’ list 2020-10-10 23:34:21 +02:00