Commit graph

4647 commits

Author SHA1 Message Date
Daniel Eklöf
97e64e2caf
box-drawing: wedges: pre-load x_halfs[] and y_thirds[]
This reduces the number of loads in the rest of the function.
2021-08-05 19:51:43 +02:00
Daniel Eklöf
0e10d2b1a2
box-drawing: wedges: avoid floating point math
Re-use the pre-calculated offsets used by the sextants. This is the correct
thing to do since wedges *should* align with sextants.
2021-08-05 19:51:42 +02:00
Daniel Eklöf
950c1b6010
box-drawing: pre-calculate sextant x,y offsets
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.
2021-08-05 19:51:42 +02:00
Daniel Eklöf
469d5abc69
box-drawing: deal with quads in the same as sextants
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”.
2021-08-05 19:51:42 +02:00
Daniel Eklöf
1dcdc42091
box-drawing: don’t inline horizontal-one-eighth-block-N 2021-08-05 19:51:42 +02:00
Daniel Eklöf
67e285f16c
box-drawing: don’t inline light diagional 2021-08-05 19:51:42 +02:00
Daniel Eklöf
29a0c925b7
Merge branch 'box-drawing-wedges'
Closes #474
2021-08-05 19:50:43 +02:00
Daniel Eklöf
36ecd0baed
box-drawing: wedges: fix alignment of inverted wedges
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.
2021-08-05 18:25:01 +02:00
Daniel Eklöf
56d7a51d35
box-drawing: wedges: don’t group similar cases together
Since they’re not exactly alike, we still need branches within each case. Better
to split them up - one case per codepoint.
2021-08-05 18:25:01 +02:00
Daniel Eklöf
1c43fdbea4
box-drawing: add U+1FB3C-U+1FB6F, U+1FB9A and U+1FB9B
These are the “wedges” from the Unicode 13 “Legacy Computing” symbols.

Closes #474
2021-08-05 18:25:01 +02:00
Daniel Eklöf
bdaa9a8991
term: disable debug logging 2021-08-05 18:24:52 +02:00
Daniel Eklöf
347cda14cf
Merge branch 'async-client-termination' 2021-08-03 19:06:29 +02:00
Daniel Eklöf
f1d440e139
term: send SIGTERM/SIGKILL to the entire process group 2021-07-31 22:50:19 +02:00
Daniel Eklöf
98e8778e41
changelog: asynchronous client application termination 2021-07-31 20:13:52 +02:00
Daniel Eklöf
b7edfc2822
term: fix release builds when LOG_ENABLE_DBG=0 2021-07-31 19:52:23 +02:00
Daniel Eklöf
03f952cf4d
term: consolidate shutdown related state into an anonymous struct 2021-07-31 19:08:51 +02:00
Daniel Eklöf
c23bff4189
term: rename: slave_died() -> fdm_client_terminated() 2021-07-31 18:27:02 +02:00
Daniel Eklöf
384b1c330f
term: asynchronous client application termination
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.
2021-07-31 18:18:48 +02:00
Daniel Eklöf
35041cd431
Merge branch 'tilde-expansion-in-include'
Closes #659
2021-07-31 10:08:53 +02:00
Daniel Eklöf
8f307178df
config: include: use xasprintf() instead of two calls to snprintf() 2021-07-31 00:39:51 +02:00
Daniel Eklöf
e2f08efacb
editorconfig: don’t trim trailing whitespace in *.scd
Doing so ruins the indentation of empty-line separated paragraphs.
2021-07-30 18:01:28 +02:00
Daniel Eklöf
0b6ec4da71
client: remove info log of client app’s exit-code 2021-07-30 15:38:20 +02:00
Daniel Eklöf
ed855c72dc
doc: foot.ini: include paths are allowed to begin with ~/ 2021-07-30 14:57:35 +02:00
Daniel Eklöf
7cfa48f369
config: include: handle get_user_home_dir() returning NULL 2021-07-30 14:57:35 +02:00
Daniel Eklöf
02f0e0d912
config: include: add support for ~-expansion
Closes #659
2021-07-30 14:57:28 +02:00
Daniel Eklöf
46d30406be
doc: foot.ini: indent lists 2021-07-30 14:56:55 +02:00
Daniel Eklöf
a71a64481e
Merge branch 'editorconfig' 2021-07-28 11:39:29 +02:00
Daniel Eklöf
64d92146db
editorconfig: initial 2021-07-28 11:39:15 +02:00
Daniel Eklöf
8bdd019227
Merge branch 'bright_bold' 2021-07-26 21:40:26 +02:00
David Rosca
2c5a23867f
Only brighten palette colors with bold-text-in-bright=palette-based 2021-07-26 19:13:46 +02:00
Daniel Eklöf
be24bd2d32
changelog: initialize output scaling factor to 1 2021-07-26 19:00:56 +02:00
Nihal Jere
52f50c556d
wayland: set scale to 1 by default
The wl_output protocol specifies that the client should assume
that scale is 1 if not set by the compositor.
2021-07-26 11:18:37 +02:00
Daniel Eklöf
075290deb6
readme: mention XTVERSION 2021-07-25 10:50:24 +02:00
Daniel Eklöf
7db8e06f55
Merge branch 'dont-hang-when-wl-connection-is-broken'
Closes #651
2021-07-25 10:14:15 +02:00
Daniel Eklöf
bcd28311f4
wayland: prevent hang when terminating due to broken Wayland connection
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
2021-07-24 20:38:56 +02:00
Daniel Eklöf
51250c64cc
doc: meson: no need to check for scdoc again
We’re already checking for scdoc in the top-level meson.build
2021-07-24 16:42:47 +02:00
Daniel Eklöf
7c686208a1
meson: add -Ddocs=disabled|enabled|auto command line option
When enabled (the default, if scdoc is found), we build and install
the man pages, example foot.ini, readme, changelog and license files.
2021-07-24 13:12:10 +02:00
Daniel Eklöf
b8d68afbb9
Merge branch 'csd-title'
Closes #638
2021-07-24 11:03:15 +02:00
Daniel Eklöf
c38b3507bc
doc: foot.ini: mention that csd.font is sized using the title bar size 2021-07-24 11:02:44 +02:00
Daniel Eklöf
4c89006d06
foot.ini: add csd.font 2021-07-24 11:02:43 +02:00
Daniel Eklöf
7714fcde83
render: render_osd(): use fcft_text_run_rasterize(), if available 2021-07-24 11:02:43 +02:00
Daniel Eklöf
e2e28db7de
render: render_osd(): fix rendering of color bitmap glyphs 2021-07-24 11:02:43 +02:00
Daniel Eklöf
bf285ae00a
render: render_osd(): don’t re-instantiate foreground color for each glyph 2021-07-24 11:02:43 +02:00
Daniel Eklöf
5c683d2c08
render: render_osd(): don’t assume a monospace font 2021-07-24 11:02:43 +02:00
Daniel Eklöf
50f59fe575
config: add csd.font option 2021-07-24 11:02:43 +02:00
Daniel Eklöf
9985b8c713
changelog: window title in CSDs 2021-07-24 11:02:43 +02:00
Daniel Eklöf
0cf7a19616
render: csd_title(): use a custom font, sized based on the title bar’s height
We still use the primary font, but use a custom size, based on the
title bar’s height.

This fixes an issue where the window title could be way too small, or
way too big. And changed size when the terminal font size was changed.
2021-07-24 11:02:42 +02:00
Daniel Eklöf
4a41575cb5
render: render_osd() now needs a ‘font’ argument 2021-07-24 11:02:42 +02:00
Daniel Eklöf
5fe23c0215
render: render_osd(): pass font as argument 2021-07-24 11:02:42 +02:00
Daniel Eklöf
3d9536caff
render: refresh CSD in render_refresh_title(), not render_update_title()
This fixes an issue where the CSD title sometimes got stuck on an
“old” title.
2021-07-24 11:02:42 +02:00