Commit graph

709 commits

Author SHA1 Message Date
Daniel Eklöf
286db002f8
meson: fix version generation from git
run_command() was only run at configure time, meaning the generated
version (that was passed on to the sources via -DFUZZEL_VERSION)
became stale.

Fix by implementing a shell script that generates a header file, and
wrap this in a custom target that is run every time (but the generated
file is only updated when the version changes)
2019-10-19 22:09:52 +02:00
Daniel Eklöf
6fd4f6000b
font: glyph_for_wchar(): ensure glyph->valid == false, in *all* error cases 2019-10-18 19:50:48 +02:00
Daniel Eklöf
3c42691e1b
font: load fallback fonts on demand
When instantiating a primary font, build the fallback font list, but
don't actually instantiate the fallback fonts.

Instead, remember the (full) pattern that we should use if/when we
instantiate it.

Then, when looking up a glyph and we need a fallback font, loop the
list and instantiate the font(s) there and then.
2019-10-17 17:53:03 +02:00
Daniel Eklöf
e218e19ea3
font: load all fallbacks when instantiating a primary font
The caching of fallback fonts didn't work. It "worked" because we
didn't free the fonts... When we started doing that, the fallback
fonts were no longer cached.

Another solution would have been to keep the cached fallback fonts
around until exit, and free them there. But that didn't seem very
clean.

So, for now, load *all* fallbacks when instantiating a
primary (non-fallback) font.

Note that this slows down initial startup time.
2019-10-17 17:43:40 +02:00
Daniel Eklöf
5a80bcff18
font: rename cache -> glyph_cache 2019-10-17 17:12:04 +02:00
Daniel Eklöf
1875f98945
font: fc_idx may not be the requested one 2019-10-17 17:07:37 +02:00
Daniel Eklöf
af85c10127
font: rename fc_loaded_fonts -> fc_loaded_fallbacks 2019-10-17 17:07:22 +02:00
Daniel Eklöf
6f52b86105
Merge branch 'font-cache' 2019-10-16 22:35:44 +02:00
Daniel Eklöf
04edd96018
font: cache top-level fonts
This greatly improves the performance when loading user-configured
fallback fonts.

Previously, we had to re-load these fallback fonts over and over again
for each (new) glyph.
2019-10-16 22:34:23 +02:00
Daniel Eklöf
bf5ad13df0
font: from_name() returns an allocated font struct 2019-10-16 22:22:26 +02:00
Daniel Eklöf
928e86b423
font: cache loaded fontconfig fallback fonts 2019-10-16 22:18:57 +02:00
Daniel Eklöf
a789230cf9
font: font_from_name() returns an allocated font struct 2019-10-16 21:52:12 +02:00
Daniel Eklöf
3ca6f9fe0b
selection: replace \r\n with \n in pasted text 2019-10-16 21:14:45 +02:00
Daniel Eklöf
bb0ce50b24
README: link to PKGBUILD 2019-10-05 16:41:20 +02:00
Daniel Eklöf
6280d58434
desktop: clean up, remove unsupported entries
* We don't support startup notifications
* We don't support a non-standard "new" action
2019-09-29 20:50:27 +02:00
Daniel Eklöf
33250bb781
PKGBUILD: version has been bumped to 0.9.0 2019-09-29 15:05:14 +02:00
Daniel Eklöf
4594899114
csi: ignore invalid scrolling regions
There must be at least one scrolling row. I.e. the bottom margin must
be larger than the top margin.

Note that trying to set an invalid region really will
be *ignored*. I.e. we *don't* reset the scrolling region.

This conforms to xterm's behavior.
2019-09-29 14:58:02 +02:00
Daniel Eklöf
5a0bb292ee
font: calculate underline/strikeout metrics in font, not main 2019-09-29 13:03:48 +02:00
Daniel Eklöf
780a346071
vt: don't log ignored execute commands
cat:ing a binary file would otherwise result in us spamming syslog.
2019-09-28 13:59:11 +02:00
Daniel Eklöf
67905c6000
render: handle compositors that does buffer swapping
Not all compositors support buffer re-use. I.e. they will call the
frame callback *before* the previous buffer has been
released. Effectively causing us to swap between two buffers.

Previously, this made us enter an infinite re-render loop, since we
considered the window 'dirty' (and in need of re-draw) when the buffer
is different from last redraw.

Now, we detect the buffer swapping case; size must match, and we must
not have any other condition that require a full repaint.

In this case, we can memcpy() the old buffer to the new one, without
dirtying the entire grid. We then update only the dirty cells (and
scroll damage).

Note that there was a bug here, where we erased the old
cursor *before* checking for a new buffer. This worked when the buffer
had *not* changed.

Now that we need to handle the case where it *has* changed, we must do
the memcpy() *before* we erase the cursor, or the re-painted cell is
lost.

This makes foot work on Plasma, without burning CPU. The memcpy() does
incur a performance penalty, but we're still (much) faster than
e.g. konsole. In fact, we're still mostly on par with Alacritty.
2019-09-27 19:33:45 +02:00
Daniel Eklöf
b87bf0dd9d
render: attach buffer *before* generating damage
Fixes 'invisible window' on Plasma
2019-09-27 19:33:10 +02:00
Daniel Eklöf
3dd5b1fe60
main: unset DESKTOP_STARTUP_ID
This is used in the desktop startup notification protocol. We don't
support it (is it even used on Wayland?), but need to ensure programs
launced from within foot doesn't inherit it.
2019-09-26 18:41:39 +02:00
Daniel Eklöf
f862f173f5
input: scale coordinates in wl_pointer_enter() 2019-09-26 18:41:26 +02:00
Daniel Eklöf
2d6369482e
main: initialize scale to '1'
This ensures we always have a valid (but possibly incorrect) scaling
value. This allows us to simplify code that uses the scale - it
doesn't have to verify the scale if valid.

Furthermore, since render_resize() is the function that actually
updates term->scale, make sure to call it *before* updating the
cursor (otherwise, the cursor will use the old scaling value).
2019-09-26 18:39:49 +02:00
Daniel Eklöf
7323f18859
PKGBUILD: explicitly set --term=xterm
The 'foot' terminfo may not be installed/available when we run the
intermediate foot binary, so explicitly use 'xterm' instead.
2019-09-26 18:37:29 +02:00
Daniel Eklöf
16f15d1a36
selection: primary: don't require compositor to implement it 2019-09-25 19:26:55 +02:00
Daniel Eklöf
5340204cbc
main: we prefer xdg-output-manager version 2, but get by with 1 2019-09-24 19:44:14 +02:00
Daniel Eklöf
b0d5af51d0
main: log (at debug level) global interfaces and their versions 2019-09-24 19:43:43 +02:00
Daniel Eklöf
d2bfb0c97c
README: that -> the 2019-09-21 21:00:40 +02:00
Daniel Eklöf
41618ee217
README: remove badges (added directly to gitlab project instead) 2019-09-21 20:51:47 +02:00
Daniel Eklöf
c222ee1462
README: add CI pipeline badge 2019-09-21 20:46:57 +02:00
Daniel Eklöf
64bf6257ec
doc: user Courier New instead of Arial in font examples
Since Courier New is monospaced, while Arial is not.
2019-09-21 20:43:29 +02:00
Daniel Eklöf
6d5d3a8d7d
It's Hz, not HZ 2019-09-21 20:09:06 +02:00
Daniel Eklöf
f20b08db3d
main: -f,--font now accepts a list of fonts
This makes -f,--font behave just like the configuration file option
'font'; the first font in the list is the primary font, and the
remaining fonts are fallback fonts used when a glyph cannot be found
in the primary font.
2019-09-21 20:01:55 +02:00
Daniel Eklöf
933e165164
doc: describe font fallback handling 2019-09-21 19:50:16 +02:00
Daniel Eklöf
10f8bffc02
PKGBUILD: need python to run generate-alt-random-writes.py 2019-09-21 19:40:02 +02:00
Daniel Eklöf
1521f47a49
README: don't emphasize entries in "known issues" list 2019-09-21 12:14:51 +02:00
Daniel Eklöf
548bc5a0ed
README: add text reflow to list of known issues 2019-09-21 12:14:03 +02:00
Daniel Eklöf
29b5a14f55
config: change default bright5 and bright 6 colors
They where previously identical to the corresponding 'regular'
colors. Now, we've done a saturated add with 0x202020 (which seems to
be roughly the difference between the other regular and bright
colors).
2019-09-21 12:09:50 +02:00
Daniel Eklöf
68e89c6fbf
config: change default 'regular0' color
0x222222 appears to be more visible against the default
background (0x111111) than 0x000000.
2019-09-21 12:01:29 +02:00
Daniel Eklöf
b2ca984ccb
main: round strikeout and underline position fallback handling 2019-09-21 00:47:17 +02:00
Daniel Eklöf
a1cd3769a3
main: round strikeout position, and ceil strikeout thickness
This fixes an issue where sometimes the strikeout thickness where
truncated to 0 (e.g. Cascadia Code).

Note that we already do this for the underline calculations.
2019-09-21 00:46:15 +02:00
Daniel Eklöf
55968413b6
render: remove assertion that isn't always true
It's not true for e.g. Cascadia code.
2019-09-21 00:45:22 +02:00
Daniel Eklöf
722290bae9
PKGBUILD: foot-terminfo depends on ncurses 2019-09-21 00:29:17 +02:00
Daniel Eklöf
31efe8c9e9
PKGBUILD: 'foot' optionally depends on 'foot-terminfo' 2019-09-21 00:26:29 +02:00
Daniel Eklöf
a26689fcdc
PKGBUILD: break out terminfo files to a separate package 2019-09-21 00:22:28 +02:00
Daniel Eklöf
ce4d2a085a
generate-alt-random-writes: reduce output size 2019-09-20 22:39:09 +02:00
Daniel Eklöf
4d558d8bed
main: names for poll FD indices 2019-09-20 22:27:27 +02:00
Daniel Eklöf
b3a419f427
main: better names of timers for delayed rendering timeouts 2019-09-20 22:21:06 +02:00
Daniel Eklöf
1a9ec997b3
main: track output refresh rate 2019-09-20 22:15:18 +02:00