Commit graph

55 commits

Author SHA1 Message Date
Daniel Eklöf
3f7be59062
config: add csd.double-click-to-maximize=no|yes option
When enabled, double-clicking the CSD titlebar will (un)maximize the
window.

Defaults to ‘yes’ (since this is the old hard-coded behavior).

Closes #1293
2023-07-14 12:03:35 +02:00
CismonX
d2fcb5343f
input: add basic support for touchscreen input
Closes #517
2023-07-05 16:22:28 +02:00
Daniel Eklöf
64b6b5d2a7
config: dpi-aware: remove ‘auto’ value, and default to ‘no’
We now default to scaling fonts using the scaling factor, not monitor
DPI.

The ‘auto’ value for dpi-aware has been removed.

Documentation (man pages and README) have been updated to reflect the
new default.
2023-06-29 15:38:23 +02:00
Dan Bungert
690d78edfa
test: config: add test for url.protocols option 2023-06-15 14:40:47 +02:00
Daniel Eklöf
f4b8e4f4d6
test: config: add test for main.utmp-helper option 2023-05-22 18:47:38 +02:00
Daniel Eklöf
e78319fccd
utmp: rewrite utmp logging
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
2023-05-22 18:47:25 +02:00
Daniel Eklöf
27c52fb4e3
test: config: call FcIni() + FcFini()
Some of the config options we’re testing result in calls to FontConfig
APIs. Without calling FcIni()+FcFini(), we leak memory:

  Direct leak of 768 byte(s) in 3 object(s) allocated from:
      #0 0x7f7e95cbfa89 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
      #1 0x7f7e95bd1fe5  (/usr/lib/libfontconfig.so.1+0x20fe5)

  Indirect leak of 96 byte(s) in 3 object(s) allocated from:
      #0 0x7f7e95cbf411 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77
      #1 0x7f7e95bd63fd  (/usr/lib/libfontconfig.so.1+0x253fd)

  Indirect leak of 19 byte(s) in 2 object(s) allocated from:
      #0 0x7f7e95c72faa in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cpp:439
      #1 0x7f7e95bd1898 in FcValueSave (/usr/lib/libfontconfig.so.1+0x20898)
2023-03-31 10:30:58 +02:00
Harri Nieminen
ae26915916 fix typos 2023-03-29 00:45:18 +03:00
Daniel Eklöf
f6ca8c90e1
config: add ‘font-size-adjustment=N[px|%]’ option
This patch adds a new config option, font-size-adjustment.

It lets you configure how much the font size should be
incremented/decremented when zooming in or out (ctrl-+, ctrl+-).

Values can be specified in points, pixels or percent.

Closes #1188
2022-12-17 10:59:17 +01:00
Daniel Eklöf
aa10b1d2da
Add support for creating utmp records
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.
2022-09-23 23:02:25 +02:00
Yorick Peterse
a0942f950d
config: add setting for underline thickness
This adds an "underline-thickness" setting to the "main" section,
similar to the existing "underline-offset" setting. This setting is used
to specify a custom height for regular (= non-cursor) underlines.

Fixes #1136
2022-08-20 22:16:32 +02:00
Daniel Eklöf
d79a3b9350
config: add colors.search-box-{no-,}match
Closes #1112
2022-07-28 19:02:56 +02:00
Daniel Eklöf
4873004c37
test: config: test colors.{jump-labels,scrollback-indicator} 2022-07-28 19:02:55 +02:00
Daniel Eklöf
8436e6acea
test: config: new test for the new ‘environment’ section 2022-06-13 11:55:24 +02:00
Daniel Eklöf
fbcebd4f1c
config: add [csd].hide-when-maximized=yes|no
When enabled, the CSD titlebar will be hidden when the window is
maximized.

Closes #1019
2022-04-16 11:45:50 +02:00
Daniel Eklöf
99db7aa7cf
config: config_free(): pass conf struct by pointer, not by-value 2022-04-12 15:21:43 +02:00
Daniel Eklöf
0018e570d4
tests: config: initial tests for text-bindings 2022-02-16 23:02:07 +01:00
Daniel Eklöf
757768dbe5
config: rename csd.color.close -> quit
This fixes a compilation error on FreeBSD:

../../foot/render.c:2055:45: error: no member named 'epoll_shim_close' in 'struct config::(anonymous at ../../foot/config.h:254:9)'
        conf_color = &term->conf->csd.color.close;
                      ~~~~~~~~~~~~~~~~~~~~~ ^

/usr/local/include/libepoll-shim/epoll-shim/detail/common.h:8:15:
note: expanded from macro 'close': #define close epoll_shim_close
2022-02-09 17:51:05 +01:00
Daniel Eklöf
e5c5cd5478
config: ‘pipe’ is now optional ‘aux’ data in the key-binding struct
This allows us to add helper functions that e.g. compare bindings’ aux
data in a generic way.
2022-02-09 17:51:05 +01:00
Daniel Eklöf
9814d96206
config: rename enum config_key_binding_type -> key_binding_type 2022-02-09 17:51:05 +01:00
Craig Barnes
ff90781ebc tests: fix typo in error message 2022-02-07 12:32:23 +00:00
Daniel Eklöf
203a09d533
meson: tests: config: add missing ‘wayland_client’ dependency
Closes #918
2022-02-06 12:02:42 +01:00
Daniel Eklöf
e0227266ca
fcft: adapt to API changes in fcft-3.x
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
2022-02-05 17:00:54 +01:00
Daniel Eklöf
467e4f2ef8
test: config: tweak.grapheme-shaping can’t be set when grapheme-clustering has been disabled 2022-01-13 12:26:20 +01:00
Daniel Eklöf
9bd9f55d5a
test: config: test ‘tweak’ section 2022-01-13 12:16:57 +01:00
Daniel Eklöf
c0aa414404
test: config: colors: test ‘256’ is an invalid key 2021-12-30 21:49:08 +01:00
Daniel Eklöf
b7976e9565
test: config: test colors section 2021-12-29 19:54:21 +01:00
Daniel Eklöf
3583d1cd98
test: config: csd: test color options 2021-12-29 19:43:11 +01:00
Daniel Eklöf
7938b9e811
test: config: add test_color() utility function 2021-12-29 19:43:01 +01:00
Daniel Eklöf
a780a8b66f
test: config: test csd section 2021-12-29 19:33:18 +01:00
Daniel Eklöf
8b2e46b6dc
test: config: test mouse section 2021-12-29 19:18:41 +01:00
Daniel Eklöf
956f8995b9
test: config: test cursor section 2021-12-29 19:18:40 +01:00
Daniel Eklöf
58ce3b4a17
test: config: test URL section 2021-12-29 19:18:40 +01:00
Daniel Eklöf
8aa0ab0d9a
test: config: rename ‘conf_ptr’ -> ‘ptr’ 2021-12-29 19:10:37 +01:00
Daniel Eklöf
67edb43db4
test: config: scrollback: test indicator-positition 2021-12-29 19:04:19 +01:00
Daniel Eklöf
e058a43689
test: config: main: test dpi-aware, selection-target and initial-window-mode 2021-12-29 19:03:59 +01:00
Daniel Eklöf
a7c489980e
test: config: add test_enum() utility function 2021-12-29 19:03:36 +01:00
Daniel Eklöf
4986df7eeb
test: config: fix format specifier: uint32_t needs %u, not %hu 2021-12-26 13:03:45 +01:00
Daniel Eklöf
2fa29fb5f4
test: config: test ‘scrollback’ section 2021-12-26 12:37:12 +01:00
Daniel Eklöf
cd9b936003
test: config: add test_double() utility function 2021-12-26 12:36:55 +01:00
Daniel Eklöf
193c696d03
test: config: add test_uint32() utility function 2021-12-26 12:36:43 +01:00
Daniel Eklöf
c765d6722c
test: config: bindings: verify pipe argv 2021-12-25 23:37:04 +01:00
Daniel Eklöf
2c4e6680aa
test: config: test [bell].command (spawn template) 2021-12-25 23:33:39 +01:00
Daniel Eklöf
a4af00bd8b
test: config: test [main].notify (spawn template) 2021-12-25 23:33:39 +01:00
Daniel Eklöf
46eea75614
test: config: add test_spawn_template() utility function 2021-12-25 23:33:38 +01:00
Daniel Eklöf
ba851c963e
test: config: ‘bell’ section 2021-12-25 23:03:11 +01:00
Daniel Eklöf
454d4e22aa
test: config: verify setting an empty key/mouse binding fails 2021-12-18 20:42:37 +01:00
Daniel Eklöf
f077a2e77a
test: config: verify collisions with the mouse override modifiers are detected 2021-12-11 20:44:01 +01:00
Daniel Eklöf
40249ab3a2
test: config: port key/mouse binding tests to new API 2021-12-11 20:19:12 +01:00
Daniel Eklöf
87c454c044
test: meson: add fontconfig to ‘test-config’ binary (fixes PGO builds) 2021-12-11 20:09:30 +01:00