aboutsummaryrefslogtreecommitdiff
path: root/meson.build (follow)
Commit message (Collapse)AuthorAgeLines
* meson: bump version to 1.20.2Daniel Eklöf2025-01-18-1/+1
|
* meson: fix dependencies (utf8proc missing in lots of places)Daniel Eklöf2025-01-18-3/+7
|
* meson: bump version to 1.20.11.20.1Daniel Eklöf2025-01-03-1/+1
|
* meson: bump version to 1.20.01.20.0Daniel Eklöf2025-01-01-1/+1
|
* meson: bump version to 1.19.01.19.0releases/1.19Daniel Eklöf2024-10-23-1/+1
|
* meson: detect wayland-protocols >= 1.37, and conditionally enable xdg-toplevel-icon-v1Daniel Eklöf2024-09-13-0/+9
|
* xsnprintf: various improvements related to xvsnprintf() and xsnprintf()Craig Barnes2024-09-13-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary of changes: * Make xvsnprintf() static * restrict-qualify pointer arguments (as done by the libc equivalents) * Make comments and spec references more thorough * Remove pointless `n <= INT_MAX` assertion (see comment) * Use FATAL_ERROR() instead of xassert() (since the assertion is inside a shared util function but the caller is responsible for ensuring the condition holds true) * Change some callers to use size_t instead of int for the return value (negative returns are impossible and all subsequent uses are size_t) The updated comments and code were taken (and adapted) from: https://gitlab.com/craigbarnes/dte/-/blob/49260bb154bca0434462a41c061e512540ec2e49/src/util/xsnprintf.c#L6-50 This work was entirely authored by me and I hereby license this contribution under the MIT license (stated explicitly, so that there's no ambiguity w.r.t. the original license).
* desktop: rename to foot{,client,-server}.desktopDaniel Eklöf2024-09-08-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | That is, skip the reverse DNS naming scheme suggested by the .desktop specification, and directly match our app-ids ("foot", and "footclient"). This simplifies .desktop -> window instance mapping, allowing DEs to match the filenames directly, without having to look at the StartupWMClass key in the .desktop files. These are the original names of the .desktop files. There were renamed (to use the reverse DNS syntax) to please the flathub people, who *required* this scheme to accept the foot package. But, since: * We don't package foot ourselves * We don't go out of our way to support non-distro packaging schemes * Flathub still hasn't merged the foot PR (it's now 2 years old) * There are no know issues in any known DE that prevents a non-reverse DNS .desktop filename from working * There are plenty of other applications that doesn't use reverse DNS names (a very clear majority, in my case) Let's just revert back to the simpler naming scheme. Closes #1607
* meson: bump version to 1.18.11.18.1releases/1.18Daniel Eklöf2024-08-14-1/+1
|
* meson: add "prefix: '#include <unistd.h>" to cc.has_function()Daniel Eklöf2024-08-09-2/+5
| | | | When checking for execvpe, include <unistd.h>
* meson: fix false positive detection of `memfd_create`Shogo Yamazaki2024-08-09-1/+2
| | | | | Add the arguments to `has_function` to properly detect availability of the function on SDK environments.
* meson: bump version to 1.18.01.18.0Daniel Eklöf2024-08-02-1/+1
|
* meson/pgo: fix PGO build errors with recent meson(?) versionsDaniel Eklöf2024-07-18-0/+6
| | | | | | The back-reference to 'tokenize.c' in the parent directory causes PGO build failures, where gcc can't find the PGO data. Likely due to path/naming issues caused by meson's generated build directories.
* vt: only apply VS-15/16 to valid sequencesDaniel Eklöf2024-06-25-1/+10
| | | | | | | | | | At compile time, build a lookup table from the Unicode data file 'emoji-variation-sequences.txt'. At run-time, when we detect a VS-15/16 sequence, do a lookup in this table, and enforce the variation selector iff the sequence is valid. Closes #1742
* meson: auto-detect execvpe on FreeBSDJan Beich2024-06-07-0/+5
| | | | https://github.com/freebsd/freebsd-src/commit/0667d0e0e365
* render: use single-pixel buffers for overlays, when possibleDaniel Eklöf2024-05-22-0/+1
| | | | | | | | | | | | | | | | | | | The unicode-mode, and flash overlays are single color buffers. This means we can use the single-pixel buffer protocol. It's undefined whether the compositor will release the buffer or not; to make things easier, simply destroy the buffer as soon as we've committed it. Note that since compositors don't necessarily release single-pixel buffers, we can't plug them into our own buffer interface. This means we can't use buffer pointers to check if we can re-use the previous buffer (i.e. we can skip comitting a new buffer), or if we have to create a new one. It's _almost_ enough to just check if the last overlay style is the same as the current one. Except that that doesn't take window resizes into account...
* meson: bump version to 1.17.21.17.2releases/1.17Daniel Eklöf2024-04-17-1/+1
|
* meson: bump version to 1.17.11.17.1Daniel Eklöf2024-04-11-1/+1
|
* meson: bump version to 1.17.01.17.0Daniel Eklöf2024-04-02-1/+1
|
* meson: bump version to 1.16.21.16.2releases/1.16Daniel Eklöf2023-10-17-1/+1
|
* meson: bump version to 1.16.11.16.1Daniel Eklöf2023-10-12-1/+1
|
* meson: bump version to 1.16.01.16.0Daniel Eklöf2023-10-11-1/+1
|
* meson: allow building with wayland-protocols as a subprojectDaniel Eklöf2023-08-08-12/+14
|
* wayland: cursor-shape-v1 is now always availableDaniel Eklöf2023-08-07-12/+2
| | | | Since we're requiring wayland-protocols >= 1.32
* wayland: fractional-scale-v1 is now always availableDaniel Eklöf2023-08-07-9/+2
| | | | Since we're requiring wayland-protocols >= 1.32
* wayland: xdg-activation is now always availableDaniel Eklöf2023-08-07-8/+1
| | | | Since we're requiring wayland-protocols >= 1.32
* meson: require wayland-protocols >= 1.32Daniel Eklöf2023-08-07-1/+1
|
* meson: bump version to 1.15.31.15.3releases/1.15Daniel Eklöf2023-08-07-1/+1
|
* meson: bump version to 1.15.21.15.2Daniel Eklöf2023-07-30-1/+1
|
* meson: add -Dterminfo-base-name optionDaniel Eklöf2023-07-28-3/+9
| | | | | | | | | | | | | | | | This defines the base name of the generated terminfo files. It defaults to the value of -Ddefault-terminfo (i.e. 'foot') Example: meson -Ddefault-terminfo=foot-bananas -Dterminfo-base-name=foot-apples The generated terminfo files will be * terminfo/f/foot-apples * terminfo/f/foot-apples-direct The default value of $TERM will be 'foot-bananas'
* meson: bump version to 1.15.11.15.1Daniel Eklöf2023-07-21-1/+1
|
* Ties systemd units to graphical-session.targetMax Gautier2023-07-21-2/+2
| | | | | | | - wayland-instance template target was a mistake. Systemd does not support simultaneous same user session, so stop trying to go against that. - Only start systemd units in Wayland environments.
* meson: bump version to 1.15.01.15.0Daniel Eklöf2023-07-14-1/+1
|
* meson: move cursor-shape.{c,h} from ‘foot’ binary to vtlibDaniel Eklöf2023-07-03-1/+1
| | | | | This should fix a build issue when doing partial PGO builds, when cursor-shape-v1 is *available*.
* meson: log availability of cursor-shape-v1Daniel Eklöf2023-07-03-0/+4
|
* meson: bump wayland-protocols version required for cursor-shape to 1.32Daniel Eklöf2023-07-03-2/+1
|
* meson: cursor-shape: use .xml from wayland-protocolsDaniel Eklöf2023-07-03-5/+7
| | | | | | | | This patch assumes a git snapshot of wayland-protocols are installed. We need to bump the version number as soon as the next version of wayland-protocols have been released.
* cursor-shape: add support for server side cursor shapesDaniel Eklöf2023-07-03-0/+6
| | | | | | | | | | | | | This implements support for the new cursor-shape-v1 protocol. When available, we use it, instead of client-side cursor surfaces, to select the xcursor shape. Note that we still need to keep client side pointers, for: * backward compatibility * to be able to "hide" the cursor Closes #1379
* refactor: track current xcursor using an enum, instead of a char pointerDaniel Eklöf2023-07-03-0/+1
|
* meson: log availability of optional wayland protocolsDaniel Eklöf2023-06-30-0/+8
|
* meson: generate bindings for wp-fractional-scale + wp-viewportDaniel Eklöf2023-06-29-0/+5
|
* meson: use meson feed feature for scdoc inputsewn2023-06-14-1/+1
| | | | Removes the need for a shell dependency.
* utmp: rewrite utmp loggingDaniel Eklöf2023-05-22-19/+44
| | | | | | | | | | | | | | | | | | | | | | | This patch generalizes the utmp support, to not only support libutempter, but also ulog (and in the future, even more interfaces). * Rename config option main.utempter to main.utmp-helper * Add meson option -Dutmp-backend=none|libutempter|ulog|auto * Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path * utmp is no longer detected at compile time, but at runtime instead. Meson will configure the following pre-processor macros, based on the selected utmp backend: * UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot) * UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot) * UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY) * UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary The documentation has been updated to mention which arguments are passed to the helper binary. Closes #1314
* meson: bump tllist dependency version to 1.1.0Vivian Szczepanski2023-04-09-1/+1
| | | | | The tll_sort() macro was added to tllist in version 1.1.0, and so building with a previous version causes a linking error.
* meson: bump version to 1.14.01.14.0releases/1.14Daniel Eklöf2023-04-03-1/+1
|
* utils: xtgettcap: new utility, to send XTGETTCAP queriesDaniel Eklöf2022-10-07-0/+1
|
* Add support for creating utmp recordsDaniel Eklöf2022-09-23-1/+23
| | | | | | | | | | | | | | | | | This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
* chore: rename desktop filesVladimír Magyar2022-09-18-1/+1
|
* meson: bump version to 1.13.11.13.1releases/1.13Daniel Eklöf2022-08-31-1/+1
|
* meson: bump version to 1.13.01.13.0Daniel Eklöf2022-08-07-1/+1
|
* input: add new Unicode input modeDaniel Eklöf2022-07-29-0/+1
| | | | | | | | | | | | | | This mode is activated through the new key-bindings.unicode-input and search-bindings.unicode-input key bindings. When active, the user can “build” a Unicode codepoint by typing its hexadecimal value. Note that there’s no visual feedback in this mode. This is intentional. This mode is intended to be a fallback for users that don’t use an IME. Closes #1116
* wayland: log human readable SHM format names in debug buildsDaniel Eklöf2022-06-20-1/+1
|
* meson: -Dsystemd-units-dir installs even if systemd is not foundDaniel Eklöf2022-05-12-4/+4
| | | | | If -Dsystemd-units-dir is explicitly set, then install the systemd service files regardless of whether systemd is available or not.
* meson: add -Dsystemd-units-dir=<path> meson command line optionDaniel Eklöf2022-05-12-1/+7
| | | | | | | | | This allows package maintainers to override the location to which our systemd service files are installed. It’s value is an *absolute* path, and *not* relative ${prefix}. The default is ${systemduserunitdir}.
* meson: bump version to 1.12.11.12.1releases/1.12Daniel Eklöf2022-04-27-1/+1
|
* meson: bump version to 1.12.01.12.0Daniel Eklöf2022-04-22-1/+1
|
* meson: add -Dtests=false|true optionDaniel Eklöf2022-04-22-1/+5
| | | | | | | When set to false, no test binaries are neither built, nor executed (with “ninja test”). Closes #919
* doc + meson.build: update information about foot.ini, small cleanupMerlin Büge2022-04-22-1/+1
| | | | | | | | | | | | | | | | | | | - foot.ini.5: mention location of example config file - foot.1: replace outdated (or incomplete) information about the location of the config file with references to foot.ini.5 - foot.1 and foot.ini.5: conform to scdoc specification, thus surround each header with (at least) one blank line. additionally consistently use exactly one line before/after each header (was sometimes two before) - foot.1: some parts of the keybindings had their own section, move into KEYBOARD SHORTCUTS section - foot.1: move EXIT STATUS section to the end where it is commonly found - foot.1: copy information about config file handling from the beginning of foot.ini.5 into the CONFIGURATION section of foot.1 - INSTALL.md: foot.ini is no longer included in the documentation - meson.build: do not bundle foot.ini with documentation anymore, see also https://codeberg.org/dnkl/foot/pulls/1015 Closes #1002
* key-binding: new API, for handling sets of key bindingsDaniel Eklöf2022-04-17-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, our Wayland seats have been tracking key bindings. This makes sense, since the seat’s keymap determines how the key bindings are resolved. However, tying bindings to the seat/keymap alone isn’t enough, since we also depend on the current configuration (i.e. user settings) when resolving a key binding. This means configurations that doesn’t match the wayland object’s configuration, currently don’t resolve key bindings correctly. This applies to footclients where the user has overridden key bindings on the command line (e.g. --override key-bindings.foo=bar). Thus, to correctly resolve key bindings, each set of key bindings must be tied *both* to a seat/keymap, *and* a configuration. This patch introduces a key-binding manager, with an API to add/remove/lookup, and load/unload keymaps from sets of key bindings. In the API, sets are tied to a seat and terminal instance, since this makes the most sense (we need to instantiate, or incref a set whenever a new terminal instance is created). Internally, the set is tied to a seat and the terminal’s configuration. Sets are *added* when a new seat is added, and when a new terminal instance is created. Since there can only be one instance of each seat, sets are always removed when a seat is removed. Terminals on the other hand can re-use the same configuration (and typically do). Thus, sets ref-count the configuration. In other words, when instantiating a new terminal, we may not have to instantiate a new set of key bindings, but can often be incref:ed instead. Whenever the keymap changes on a seat, all key bindings sets associated with that seat reloads (re-resolves) their key bindings. Closes #931
* meson: install foot.ini to /etc/xdg/foot/foot.iniDaniel Eklöf2022-04-17-1/+1
| | | | Closes #1001
* meson: stop using deprecated functions, require meson >= 0.58Daniel Eklöf2022-02-27-5/+5
| | | | | | * get_pkgconfig_variable() -> get_variable() * prog.path() -> prog.full_path() * meson.build_root() -> meson.global_build_root()
* Adding systemd unit files for socket activationMax Gautier2022-02-26-0/+19
| | | | | | | | | | - Support for multiples concurrent instances, templated on WAYLAND_DISPLAY - Use standard input for the socket file descriptor (inetd style) - Always use the socket provided by systemd with the systemd user service - wayland-instance@.target is intended to be a special target a bit like graphical-session.target.
* meson: fcft-3.0.0 is buggy, require 3.0.1Daniel Eklöf2022-02-09-1/+1
| | | | | | | Fcft-3.0.0 is known to cause crashes. We don’t want anyone ever compiling foot against it. Closes #935
* meson: bump version to 1.11.0Daniel Eklöf2022-02-05-1/+1
|
* fcft: adapt to API changes in fcft-3.xDaniel Eklöf2022-02-05-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fcft no longer uses wchar_t, but plain uint32_t to represent codepoints. Since we do a fair amount of string operations in foot, it still makes sense to use something that actually _is_ a string (or character), rather than an array of uint32_t. For this reason, we switch out all wchar_t usage in foot to char32_t. We also verify, at compile-time, that char32_t used UTF-32 (which is what fcft expects). Unfortunately, there are no string functions for char32_t. To avoid having to re-implement all wcs*() functions, we add a small wrapper layer of c32*() functions. These wrapper functions take char32_t arguments, but then simply call the corresponding wcs*() function. For this to work, wcs*() must _also_ be UTF-32 compatible. We can check for the presence of the __STDC_ISO_10646__ macro. If set, wchar_t is at least 4 bytes and its internal representation is UTF-32. FreeBSD does *not* define this macro, because its internal wchar_t representation depends on the current locale. It _does_ use UTF-32 _if_ the current locale is UTF-8. Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is defined. Other fcft API changes: * fcft_glyph_rasterize() -> fcft_codepoint_rasterize() * font.space_advance has been removed * ‘tags’ have been removed from fcft_grapheme_rasterize() * ‘fcft_log_init()’ removed * ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
* meson: fix race build order of builtin terminfoDaniel Eklöf2022-01-15-2/+2
| | | | | | The builtin terminfo is used by dcs.c, which is built as part of the static library ‘vtlib’. Thus, vtlib needs to depend on the builtin_terminfo target.
* script: add generate-builtin-terminfo.pyDaniel Eklöf2022-01-13-1/+11
| | | | | | | This script parses a terminfo source file and generates a C header file with a static struct containing terminfo names and their values. The table is sorted on the capability names
* meson: generate-version: use CURRENT_SOURCE_DIR instead of SOURCE_ROOTDaniel Eklöf2021-12-21-1/+1
|
* test: initial external unit test suite for ‘config.c’Daniel Eklöf2021-12-11-0/+1
| | | | | | | | | | | | This patch adds a separate (external) test binary with unit tests for config.c This is achieved by having the test’s source file include config.c (yes, the C file, not the header file). This allows us to call e.g. parse_section_*() directly, without having to go through config_load() (which requires having a readable file at “path”).
* meson: bump version to 1.10.31.10.3Daniel Eklöf2021-12-08-1/+1
|
* meson: bump version to 1.10.21.10.2Daniel Eklöf2021-12-02-1/+1
|
* meson: bump version to 1.10.11.10.1Daniel Eklöf2021-11-22-1/+1
|
* footclient.desktop: new XDG desktop file, for footclientDaniel Eklöf2021-11-15-1/+1
|
* meson: add -Dthemes=false|trueDaniel Eklöf2021-11-14-1/+5
| | | | | | | This adds a new meson option that controls whether the example theme files should be installed or not. The default is true. Previously, themes were gated by the -Ddocs option.
* meson: bump version to 1.10.01.10.0Daniel Eklöf2021-11-14-1/+1
|
* meson: install themes to $datadir/foot/themesDaniel Eklöf2021-10-27-0/+1
|
* osc: use STRLEN() macro to make parse_rgb() more self-documentingCraig Barnes2021-10-20-0/+1
| | | | | The empty literals in the macro are to ensure the argument itself is a string literal, so it can't be used on anything else.
* meson/pkgbuild: bump version to 1.9.21.9.2releases/1.9Daniel Eklöf2021-10-02-1/+1
|
* meson/pkgbuild: bump version to 1.9.11.9.1Daniel Eklöf2021-10-01-1/+1
|
* meson: terminfo install location now defaults to $datadir/terminfoDaniel Eklöf2021-08-30-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | The meson command line option -Dcustom-terminfo-install-location has been changed in the following ways: * If unset, $datadir/terminfo is used, and TERMINFO is *not* exported * If set, that value (relative to $prefix) is used, and TERMINFO *is* exported. * The special value ‘no’ is removed. -Ddefault-terminfo now also changes the terminfo names generated when -Dterminfo=enabled. Furthermore, the documentation for the TERMINFO environment variable has been removed from the foot.1 and footclient.1 man pages (but as mentioned above, foot *will* still set it if -Dcustom-terminfo-install-location has been used). INSTALL.md has been updated to now recommend using ncurses’ terminfo definitions, if available. But also to document the other alternatives; installing the terminfo definitions in a custom location, or installing them with a diferent name. It also describes the general problem, and the disadvantages of each alternative (but without going into too much depth).
* meson/pkgbuild: bump version to 1.9.01.9.0Daniel Eklöf2021-08-27-1/+1
|
* meson: run generate_version.sh in a C localeDaniel Eklöf2021-08-25-1/+2
| | | | | | | | Previously, only the date command inside the script was run with LC_TIME=C. But there’s no reason to be that conservative; we absolutely do not want _anything_ in that script to generate locale dependent output.
* terminfo: install to $datadir/foot/terminfo by default, append to TERMINFO_DIRSDaniel Eklöf2021-08-17-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of 2021-07-31, ncurses ships its own version of foot’s terminfo. Since: * It doesn’t have the non-standard Sync,Tc,setrgbf,setrgbb capabilities. * It doesn’t set hs,fsl,dsl (statusbar). * We want to be able to update our termminfo without waiting for an ncurses release. * Foot should be installable and usable on Linux systems that doesn’t have the latest ncurses. we still want to ship our own version. We can however not install it to the default terminfo location (e.g. /usr/share/terminfo), since it will collide with the ncurses provided files. Our options are to either rename our terminfo to something else, or to keep the name, but install our terminfo files somewhere else. The first option would be the easy one. However, I think it makes sense to use the same name. For example, a user that SSH’s into a remote system that does *not* have our own version installed, but *does* have the ncurses one, will gracefully fall back to that one, which is better than manually having to set e.g. TERM=xterm-256color. Now, if we want to use the same name, we need to install it somewhere else. But where? And how do we ensure our version is preferred over the ncurses one? I opted to $datadir/foot/terminfo (e.g. /usr/share/foot/terminfo) by default. It makes it namespaced to foot (i.e. we’re not introducing a new “standard” terminfo location), thus guaranteeing it wont collide with ncurses. To enable applications to find it, we export TERMINFO_DIRS. This is a list of *additional* directories to search for terminfo files. If it’s already defined, we *append* to it. The nice thing with this is, if there’s no terminfo in that location (e.g. when you SSH into a remote), the default terminfo location is *also* searched. But only *after* having searched through TERMINFO_DIRS. In short: our version is preferred, but the ncurses one (or an older version of our terminfo package!) will be used if ours cannot be found. To enable packagers full control over the new behavior, the existing meson command line options have been modified, and a new option added: -Dterminfo=disabled|enabled|auto: *build* and *install* the terminfo files. -Dcustom-terminfo-install-location=<path>: *where* the terminfo files are expected to be found. This *needs* to be set *even* if -Dterminfo=disabled. For example, if the packaging script builds and packages the terminfo files separate from the regular foot build. The path is *relative to $prefix*, and defaults to $datadir/foot/terminfo. This is the value that will be appended to TERMINFO_DIRS. Note that you can set it to ‘no’, in which case foot will *not* set/modify TERMINFO_DIRS. Only do this if you don’t intend to package foot’s terminfo files at all (i.e. you plan on using the ncurses ones only). -Ddefault-terminfo=foot. Allows overriding the default TERM value. This should only be changed if the target platform doesn’t support terminfo files. Closes #671
* meson: require meson >= 0.54Daniel Eklöf2021-08-08-1/+1
| | | | We use meson.override_dependency, which was added in 0.54
* meson: add -Ddocs=disabled|enabled|auto command line optionDaniel Eklöf2021-07-24-5/+10
| | | | | When enabled (the default, if scdoc is found), we build and install the man pages, example foot.ini, readme, changelog and license files.
* meson/pkgbuild: bump version to 1.8.21.8.2releases/1.8Daniel Eklöf2021-07-18-1/+1
|
* meson/pkgbuild: bump version to 1.8.11.8.1Daniel Eklöf2021-07-01-1/+1
|
* meson/pkgbuild: bump version to 1.8.0Daniel Eklöf2021-06-25-1/+1
|
* meson: add utf8proc dep to all libraries pulling in terminal.hDaniel Eklöf2021-06-24-3/+3
|
* composed: store compose chains in a binary search treeDaniel Eklöf2021-06-24-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation stored compose chains in a dynamically allocated array. Adding a chain was easy: resize the array and append the new chain at the end. Looking up a compose chain given a compose chain key/index was also easy: just index into the array. However, searching for a pre-existing chain given a codepoint sequence was very slow. Since the array wasn’t sorted, we typically had to scan through the entire array, just to realize that there is no pre-existing chain, and that we need to add a new one. Since this happens for *each* codepoint in a grapheme cluster, things quickly became really slow. Things were ok:ish as long as the compose chain struct was small, as that made it possible to hold all the chains in the cache. Once the number of chains reached a certain point, or when we were forced to bump maximum number of allowed codepoints in a chain, we started thrashing the cache and things got much much worse. So what can we do? We can’t sort the array, because a) that would invalidate all existing chain keys in the grid (and iterating the entire scrollback and updating compose keys is *not* an option). b) inserting a chain becomes slow as we need to first find _where_ to insert it, and then memmove() the rest of the array. This patch uses a binary search tree to store the chains instead of a simple array. The tree is sorted on a “key”, which is the XOR of all codepoints, truncated to the CELL_COMB_CHARS_HI-CELL_COMB_CHARS_LO range. The grid now stores CELL_COMB_CHARS_LO+key, instead of CELL_COMB_CHARS_LO+index. Since the key is truncated, collisions may occur. This is handled by incrementing the key by 1. Lookup is of course slower than before, O(log n) instead of O(1). Insertion is slightly slower as well: technically it’s O(log n) instead of O(1). However, we also need to take into account the re-allocating the array will occasionally force a full copy of the array when it cannot simply be growed. But finding a pre-existing chain is now *much* faster: O(log n) instead of O(n). In most cases, the first lookup will either succeed (return a true match), or fail (return NULL). However, since key collisions are possible, it may also return false matches. This means we need to verify the contents of the chain before deciding to use it instead of inserting a new chain. But remember that this comparison was being done for each and every chain in the previous implementation. With lookups being much faster, and in particular, no longer requiring us to check the chain contents for every singlec chain, we can now use a dynamically allocated ‘chars’ array in the chain. This was previously a hardcoded array of 10 chars. Using a dynamic allocated array means looking in the array is slower, since we now need two loads: one to load the pointer, and a second to load _from_ the pointer. As a result, the base size of a compose chain (i.e. an “empty” chain) has now been reduced from 48 bytes to 32. A chain with two codepoints is 40 bytes. This means we have up to 4 codepoints while still using less, or the same amount, of memory as before. Furthermore, the Unicode random test (i.e. write random “unicode” chars) is now **faster** than current master (i.e. before text-shaping support was added), **with** test-shaping enabled. With text-shaping disabled, we’re _even_ faster.
* wip: grapheme shapingDaniel Eklöf2021-06-24-1/+7
|
* meson: add -Dterminfo-install-location=disabled|custom-pathDaniel Eklöf2021-06-23-2/+11
| | | | | | | | | | | | | | | | Add a new meson option, ‘terminfo-install-location’, that allows you to customize _where_ the terminfo files are installed, relative to the installation prefix. It also recognizes the special value ‘disabled’, in which case the terminfo files are not installed at all. The terminfo files _are_ however built (allowing us to catch build errors), and foot still defaults to the ‘foot’ terminfo. It defaults to $datadir/terminfo If (the other option) ‘terminfo’ is set to disabled (or tic cannot be found), terminfo-install-location is automatically set to ‘disabled’.
* client: send overrides for everything that is publicly visible in the confDaniel Eklöf2021-06-23-0/+1
| | | | | | | | | Send a generic “overrides” list to the server, containing options in text, on the format “section.key=value”. This reduces the size of the base client/server protocol packet, as well as opens up for a generic -o,--override command line option (not yet implemented).
* meson: add xdg-activation-v1.xml conditionallyDaniel Eklöf2021-05-14-2/+7
| | | | | | | | | | Only enable XDG activation when compiling against wayland-protocols 1.21. Older versions don’t have this protocol. When available, define HAVE_XDG_ACTIVATION. Make all usages of xdg_activation_v1 and xdg_activation_token_v1 conditional.
* xdg-activation: initial support for setting urgency using XDG activationDaniel Eklöf2021-05-14-0/+1
|
* meson: require fcft >= 2.4Daniel Eklöf2021-05-07-1/+1
|
* meson: add ‘xkb’ as a dependency to vtlib, pgolib and pgoDaniel Eklöf2021-05-01-3/+3
| | | | | | | | | | | | | | | | All of these include wayland.h (either directly, or indirectly), which pulls in xkbcommon.h. Reported by swayyyy on IRC: FAILED: libvtlib.a.p/dcs.c.o In file included from ../../terminal.h:19, from ../../dcs.h:4, from ../../dcs.c:1: ../../wayland.h:9:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory 9 | #include <xkbcommon/xkbcommon.h> | ^
* Merge branch 'releases/1.7'Daniel Eklöf2021-04-18-1/+1
|\
| * meson/pkgbuild: bump version to 1.7.21.7.2releases/1.7Daniel Eklöf2021-04-18-1/+1
| |
* | main: call fcft_log_init(). Note that this requires fcft >= 2.3.90Daniel Eklöf2021-04-17-1/+1
|/