Commit graph

5148 commits

Author SHA1 Message Date
Daniel Eklöf
8771bb20bf
config: scrollback: add missing return for ‘lines’
The missing return meant failures were not reported correctly.
2021-12-25 23:48:05 +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
e225be1c50
tokenize: free content of argv on failure, and reset the argv pointer
This fixes a memory leak when we failed to parse a command line (for
example, because it contained an unclosed quote).
2021-12-25 23:25:30 +01:00
Daniel Eklöf
ba851c963e
test: config: ‘bell’ section 2021-12-25 23:03:11 +01:00
Daniel Eklöf
a93e7867ff
changelog: grammar 2021-12-23 14:09:48 +01:00
Daniel Eklöf
a20e424dc0
Merge branch 'crash-on-csd-size-1'
Closes #857
2021-12-23 11:54:50 +01:00
Daniel Eklöf
41f7f8b7fa
render: make sure ‘maximized’ button doesn’t use negative coordinates 2021-12-22 20:31:38 +01:00
Daniel Eklöf
521bd84a99
config: csd.border_width now always reflects the full/total width 2021-12-22 20:21:46 +01:00
Daniel Eklöf
9df537a110
meson: generate-version: use CURRENT_SOURCE_DIR instead of SOURCE_ROOT 2021-12-21 13:40:54 +01:00
Daniel Eklöf
027603cbb8
slave: re-use ‘struct sigaction’ variable when resetting SIGHUP+SIGPIPE 2021-12-18 23:22:52 +01:00
Daniel Eklöf
fb488b6162
slave: restore SIGPIPE 2021-12-18 23:20:10 +01:00
Daniel Eklöf
59b5ba03c7
Merge branch 'error-on-empty-key-or-mouse-binding'
Closes #851
2021-12-18 21:15:22 +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
c076f03dc4
config: error out on empty key- or mouse binding
Closes #851
2021-12-18 20:39:08 +01:00
Daniel Eklöf
0b9cb6bd2f
Merge branch 'shm-buffer-busy-sometimes-not-set'
Closes #844
2021-12-18 14:41:12 +01:00
Daniel Eklöf
fc6533c920
shm: get_buffer(): make sure buffer->busy is set
When going through the cached buffers, we only set buffer->busy on
the *first* re-usable buffer we found.

In some cases, we will find more than one re-usable buffer. In this
case, we select the “youngest” one (i.e the one most recently used, in
the hopes that we can use damage tracking instead of re-rendering the
entire buffer).

If the “current” buffer is younger than the previously detected,
re-usable, buffer, then we unref:ed the previously selected buffer,
and replaced it with the current one.

But, we did not sanitize it. That is, we did not:

* set buffer->busy
* clear its dirty region
* clear its scroll damage

That buffer would eventually get rendered to, and committed to the
compositor. Later, the compositor would free it. And there, in our
buffer_release() callback, we’d assert that buffer->busy was
set. And fail.

Closes #844
2021-12-18 14:26:26 +01:00
Daniel Eklöf
fb398f473e
Merge branch 'lower-case-all-theme-names' 2021-12-18 14:25:25 +01:00
Daniel Eklöf
828e894e96
themes: consistently use snake-case in theme names 2021-12-18 14:24:30 +01:00
Daniel Eklöf
355157d3b6
Merge branch 'apprentice-theme' 2021-12-18 14:22:16 +01:00
Oğuz Ersen
dfbe9d8aa2 Add Apprentice theme 2021-12-17 19:09:38 +01:00
Daniel Eklöf
ee19c765bb
Merge branch 'kitty-kbd-dont-fallback-to-xkb-symbol' 2021-12-16 13:02:25 +01:00
Daniel Eklöf
4c5f53878e
input: kitty: don’t fallback to the XKB symbol
When handling “generic” keys (i.e. keys not in the Kitty keymap), we
use the pressed key’s Unicode codepoint as “key” in the kitty CSI.

If we failed to convert the XKB symbol to a Unicode codepoint, we used
to (before this patch), fallback to using the XKB symbol as is.

This can never be correct... and it caused us to emit a meaningless
CSI for XKB_KEY_ISO_Next_Group, which confused e.g. Kakoune.
2021-12-16 12:49:41 +01:00
Daniel Eklöf
55c5f0590e
Merge branch 'zooming-with-dpi-aware-no'
Closes #842
2021-12-14 18:11:36 +01:00
Daniel Eklöf
a098fad004
term: font_size_adjust: use DPI=96 when font is *not* scaled by DPI
Closes #842
2021-12-14 17:45:12 +01:00
Daniel Eklöf
3e5a9aa904
Merge branch 'wl-output-name-description' 2021-12-14 15:10:03 +01:00
Daniel Eklöf
01a417660d
wayland: add wl_output.name() and wl_output.description()
These are new in version 4 of the wl_output interface (first included
in wayland-1.20).

This allows us to get the name and description of the outputs, also on
compositors without the XDG output interface.
2021-12-13 19:17:48 +01:00
Daniel Eklöf
97174913e0
wayland: estimate scaled (logical) width/height, if not provided
This makes us slightly more resilient against a missing XDG output
interface.

We use the “real” (the physical) dimensions, combined with the scaling
factor, to estimate the logical dimensions.

This works out correctly with  non-fractional scaling, but not
otherwise.
2021-12-13 19:15:17 +01:00
Daniel Eklöf
fe851a6936
input: kitty: return the result of term_to_slave()
If term_to_slave() fails, then the key wasn’t ‘handled’...
2021-12-12 15:08:46 +01:00
Daniel Eklöf
aeeaf9c0ec
Merge branch 'kitty-static-keymap' 2021-12-11 21:06:58 +01:00
Daniel Eklöf
53fc9ca3b2
kitty: replace switch with a static keysym table 2021-12-11 21:04:58 +01:00
Daniel Eklöf
fd26fadc2c
Merge branch 'config-refactor-and-verify-binding-collisions-after-load' 2021-12-11 21:04:27 +01:00
Daniel Eklöf
6911a50df7
config: NOINLINE modifiers_to_str() 2021-12-11 20:59:08 +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
2a02ba77a1
config: resolve collisions: argv_compare() returns -1,0,+1, not a bool 2021-12-11 20:19:12 +01:00
Daniel Eklöf
17250ec393
config: resolve collisions: return ‘false’ on failure 2021-12-11 20:19:12 +01:00
Daniel Eklöf
6fa09d24e5
config: use “(default)” as path in log message, if path is NULL 2021-12-11 20:19:12 +01:00
Daniel Eklöf
ff82a3900e
config: remove commented out struct definition 2021-12-11 20:19:11 +01:00
Daniel Eklöf
3512a7febf
config: remove unneeded function prototype 2021-12-11 20:19:11 +01:00
Daniel Eklöf
f6a591b80a
config: unify key- and mouse bindings
With this patch, key- and mouse-bindings structs (the non-layout
specific ones) are unified into a single struct.

The logic that parses, and manages, the key- and mouse binding lists
are almost identical. The *only* difference between a key- and a mouse
binding is that key bindings have an XKB symbol, and mouse bindings a
button and click-count.

The new, unified, struct uses a union around these, and all functions
that need to know which members to use/operate on now takes a ‘type’
parameter.
2021-12-11 20:19:11 +01:00
Daniel Eklöf
4c50c44cf7
config: do mouse binding collision detection after loading the conf 2021-12-11 20:19:11 +01:00
Daniel Eklöf
bb4b4ae43d
config: value_to_key_combos(): reset modifiers in binding 2021-12-11 20:19:11 +01:00
Daniel Eklöf
e67639a682
main: ignore SIGPIPE
We want to handle SIGPIPEs without crashing... One way to trigger this
was to use e.g.

  pipe-visible=[cat /foo/bar] Control+Shift+q

That is, pipe output to something that did not consume it. This led
to a SIGPIPE when we tried to write the terminal contents to the pipe,
and crashed the whole foot instance.
2021-12-11 20:19:11 +01:00
Daniel Eklöf
197c1c5ced
config: do key binding collision detection after loading the conf
This allows the user to write, to swap two key bindings:

  [key-bindings]
  show-urls-launch=Control+Shift+r
  search-start=Control+Shift+u

instead of:

  [key-bindings]
  search-start=none
  show-urls-launch=Control+Shift+r
  search-start=Control+Shift+u

This should simplify the configuration for people who replace a lot of
the default key bindings.

This also simplifies the parsing somewhat, since we no longer has to
parse a key-binding into a temporary list, ensure it doesn’t have any
collisions, and then copy it into the actual key binding list.

_While_ parsing a key-binding, we still need a temporary array (at
least for the time being), but that temporary array is no longer
visible outside the parsing function that allocates it.
2021-12-11 20:19:11 +01:00
Daniel Eklöf
fc2bacbb78
config: remove struct key_combo, use config_key_binding instead 2021-12-11 20:19:10 +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
Daniel Eklöf
8d7dceb88a
Merge branch 'config-unittest'
Part of #813
2021-12-11 18:54:42 +01:00