Commit graph

5168 commits

Author SHA1 Message Date
Daniel Eklöf
0a656d75d4
Merge branch 'scale-outline-of-unfocused-block-cursor' 2021-12-29 11:52:48 +01:00
Daniel Eklöf
ef8d5ebca0
render: scale the width out the outline of the unfocused block cursor 2021-12-28 20:57:24 +01:00
Daniel Eklöf
fa1088da93
Merge branch 'apply-scrollback-multiplier-in-alternate-scroll-mode' 2021-12-28 17:10:24 +01:00
Daniel Eklöf
c9086e6d4f
input: apply scrollback.multplier in alterate scroll mode
Before this patch, foot only applied [scrollback].multiplier on the
normal screen, never the alt screen.

However, scrolling can be done in two ways on the alt screen:

If the application has enabled mouse support, we simply pass on the
mouse scroll events to the application. Here, it makes sense to not
apply the multiplier, and instead let the application choose how much
to scroll for each scroll event.

But, if the application has not enabled mouse support, we can still
scroll by simulating the arrow keys being pressed - alternate
scrolling (private mode 1007).

This is enabled by default in foot (but can be disabled in foot.ini
with the [mouse].alternate-scroll-mode setting).

In this mode, it makes more sense to apply the multiplier. And that’s
what this patch changes - the multiplier is now applied, on the alt
screen, when the application has not enabled mouse support, and
alternate scrolling has been enabled in foot.

Closes #859
2021-12-28 17:10:03 +01:00
Daniel Eklöf
a835436537
term_mouse_grabbed(): make ‘seat’ argument const 2021-12-28 17:10:03 +01:00
Daniel Eklöf
1217cb50d2
changelog: irc+ircs added to default value of url.protocols 2021-12-27 21:13:26 +01:00
Daniel Eklöf
cbbc142eb9
Merge branch 'irc-url' 2021-12-27 21:12:17 +01:00
Simon Ser
3f34ec7470 Add irc:// to default URL schemes 2021-12-27 12:10:44 +01:00
Daniel Eklöf
3f10ee87b1
term: print: erase existing OSC-8 URI
If we have an “active” OSC-8 URI, term_print() would correctly replace
an existing URI with the new one.

But, if we don’t have an active URI, an existing URI was not
erased. This can be reproduced with e.g

  echo -e '\e]8;;http://foo.bar\e\\foobar\e]8;;\e\\\b\b\b\b\b😀\n'
2021-12-26 14:51:26 +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
323f645bb2
Merge branch 'term-erase-refactor' 2021-12-26 12:42:05 +01:00
Daniel Eklöf
39bb6be8bf
term_erase(): replace coord-typed arguments with regular ints 2021-12-26 12:39:34 +01:00
Daniel Eklöf
366da7349c
Merge branch 'cell-colors-use-index' 2021-12-26 12:39:01 +01:00
Daniel Eklöf
b218b8cfb0
sixel: VT state’s bg color may now be an index, rather than an actual color value 2021-12-26 12:37:48 +01:00
Daniel Eklöf
c2bf2d3650
csi: store color index, not actual color, in cell’s fg/bg attributes
When using indexed colors (i.e. SGR 30/40/90/100), store the index
into the cell’s fg/bg attributes, not the actual color value.

This has a couple of consequences:

Color table lookup is now done when rendering. This means a rendered
cell will always reflect the *current* color table, not the color
table that was in use when the cell was printed to.

This simplifies the OSC-4/104 logic, since we no longer need to update
the grid - we just have to damage it to trigger rendering.

Furthermore, this change simplifies the VT parsing, since we no longer
need to do any memory loads (except loading the SGR parameter values),
only writes.
2021-12-26 12:37:48 +01:00
Daniel Eklöf
8bf757f466
csi: no need to set VT state’s fg/bg to the default ones on SGR reset 2021-12-26 12:37:47 +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
a3dc0d287d
config: update most parse_section_*() functions to return in each if-branch 2021-12-25 23:51:02 +01:00
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