ncurses has had a bug where mouse support is completely disabled if the terminfo
didn’t have kmous=\E[M, *or*, the terminfo *name* contained ‘xterm’.
This appears to have been fixed.
Thus, change kmous to \E[<, and set xm/XM accordingly. With this, ncurses
application will use the SGR mouse reporting mode, instead of the legacy
reporting mode.
../../box-drawing.c: In function 'box_drawing':
../../box-drawing.c:2774:13: error: 'y1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
2774 | int y0, y1;
| ^~
../../box-drawing.c:2774:9: error: 'y0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
2774 | int y0, y1;
| ^~
We’re using floating point math, as a way to ensure that sextant primitives
overlap, rather than leaving empty spaces, or being uneven, when the cell
width/height isn’t divisible with 2 (width) or 3 (height).
This gets rid of all floating point math from the sextant drawing functions.
That is, encode which “pieces” make up each quad in a static array, and use a
single function to draw all quads using the four primitives “upper left/right,
lower left/right”.
We render the inverted wedges by first rendering a non-inverted triangle, and
then inverting it with PIXMAN_OP_OUT.
In cases where truncating and round():ing the triangle points have different
results, the final, inverted wedge ends up being unaligned with the
corresponding sixel(s).
This patch fixes that by handling the pre-inverted triangles
specifically. I.e. we don’t re-use the same triangle coordinates as the
corresponding non-inverted triangle.
When the foot window is closed, and we need to terminate the client application,
do this in an asynchronous fashion:
* Don’t do a blocking call to waitpid(), instead, rely on the reaper callback
* Use a timer FD to implement the timeout before sending SIGKILL (instead of
using SIGALRM).
* Send SIGTERM immediately (we used to *just* close the PTY, and then wait 2
seconds before sending SIGTERM).
* Raise the timeout from 2 seconds to 60
Full shutdown now depends on *two* asynchronous tasks - unmapping the window,
and waiting for the client application to terminate.
Only when *both* of these have completed do we proceed and call term_destroy(),
and the user provided shutdown callback.
If the call to fdm_wayl() with EPOLLHUP was followed by calls to
wayl_roundtrip(), foot would hang.
The reason for this is that the EPOLLHUP handler in fdm_wayl() would
call wl_display_cancel_read().
wayl_roundtrip() also calls wl_display_cancel_read() (since we
normally have called wl_display_prepare_read()), before calling
wl_display_roundtrip().
When calling wl_display_cancel_read() two times in a row, without a
wl_display_prepare_read() in between, wl_display_roundtrip() hangs.
Fix by not calling wl_display_cancel_read() in fdm_wayl(). This
ensures our invariant holds: wl_display_prepare_read() is *always* in
effect outside of fdm_wayl().
Closes#651