Commit graph

1922 commits

Author SHA1 Message Date
Daniel Eklöf
2fd5a9ee8d
wayland: monitor unplug: call surface_leave() to handle terminal unmapping 2020-04-28 19:05:10 +02:00
Daniel Eklöf
9cfe720000
wayland: handle outputs disappearing
That is, deal with monitors being unplugged.

At least on Sway 1.4, surfaces are not unmapped before the output is
removed. Thus, in addition to free:ing the monitor resources, we also
need to update all terminals that are mapped on this output - remove
the output from their "mapped on" list.
2020-04-27 20:46:40 +02:00
Daniel Eklöf
37871aad84
wayland: group handle_global() together with handle_global_removed() 2020-04-27 20:18:03 +02:00
Daniel Eklöf
c4e3b9f69d
Merge branch 'unicode-combining' 2020-04-27 15:53:34 +02:00
Daniel Eklöf
3f3fff768a
vt: lazily reset utf8 in action_utf8_*_entry
action_clear() is in the super hot code path. Avoid resetting utf8
state there, as utf8 input is relatively uncommon.

Instead, reset it when we explicitly enter any of the utf8 collecting
states, as this is exactly the point where we need it.
2020-04-27 15:50:44 +02:00
Daniel Eklöf
d1fc419e34
vt: action_utf8_print: idx is cleared in action_clear() 2020-04-27 15:49:07 +02:00
Daniel Eklöf
4278af99d2
vt: utf8-*-entry: idx is cleared in action_clear() 2020-04-27 15:47:44 +02:00
Daniel Eklöf
e478874dd9
term: remove unneeded utf8.left member 2020-04-27 15:06:23 +02:00
Daniel Eklöf
3fb3b63d93
readme: link to utf8proc was cut off 2020-04-27 12:27:00 +02:00
Daniel Eklöf
aae998d9a3
readme: add link to utf8proc 2020-04-27 12:26:39 +02:00
Daniel Eklöf
2008207929
readme: add utf8proc to the list of dependencies 2020-04-27 12:25:35 +02:00
Daniel Eklöf
4283a8c51b
utf8: add support for unicode combining characters
This feature lets foot combine e.g. "a\u0301" to "á".

We first check if the current character (that we're about to print) is
a combining character, by checking if it's in one of the following
ranges:

* Combining Diacritical Marks (0300–036F), since version 1.0, with
  modifications in subsequent versions down to 4.1
* Combining Diacritical Marks Extended (1AB0–1AFF), version 7.0
* Combining Diacritical Marks Supplement (1DC0–1DFF), versions 4.1 to 5.2
* Combining Diacritical Marks for Symbols (20D0–20FF), since version
  1.0, with modifications in subsequent versions down to 5.1
* Combining Half Marks (FE20–FE2F), versions 1.0, with modifications
  in subsequent versions down to 8.0

If it is, we check if the last cell appears to contain a valid symbol,
and if so, we attempt to compose (combine) the last cell with the
current character, using utf8proc.

If the result is a combined character, we replace the content in the
previous cell with the new, combined character.

Thus, if you select and copy the printed character, you would get
e.g. "\u00e1" instead of "a\u0301".

This feature can be disabled. By default, it is enabled if the
utf8proc library is found, but can be explicitly disabled, or enabled,
with 'meson -Dunicode-combining=disabled|enabled'.
2020-04-27 12:13:30 +02:00
Daniel Eklöf
d959b98822
meson: bump C standard to c18 2020-04-26 19:39:08 +02:00
Daniel Eklöf
e9ed3025a8
damage: remove 'scroll' sub struct
There is no other types of damage but scroll damage.
2020-04-26 12:47:19 +02:00
Daniel Eklöf
ce280537de
render: make 'glyph' assignment more readable 2020-04-26 12:39:42 +02:00
Daniel Eklöf
db0ac438be
changelog: CSI 13;2t and CSI 14t have also been implemented 2020-04-25 23:09:10 +02:00
Daniel Eklöf
b22c7c4d0a
changelog: use backticks for full escape sequence too, and shorten entry 2020-04-25 23:07:47 +02:00
Daniel Eklöf
cb7103dadc
doc: foot.5: man page references do not embolden the section number 2020-04-25 22:40:29 +02:00
Daniel Eklöf
6b464fcf31
doc: foot.5: user -> users 2020-04-25 22:40:19 +02:00
Daniel Eklöf
91199f8b97
doc: foot.5: padding and geometry are subject to output scaling 2020-04-25 22:39:53 +02:00
Daniel Eklöf
33a53efa71
csi: log 'unhandled' for invalid 'target' and 'operation' in CSI ? S 2020-04-25 11:39:31 +02:00
Daniel Eklöf
c06890c4cd
readme: update description 2020-04-24 20:57:23 +02:00
Daniel Eklöf
0572138b09
changelog: one entry for conf-option + command line option changes 2020-04-24 20:40:33 +02:00
Daniel Eklöf
f1336a0902
Merge branch 'fcft-v2' 2020-04-24 20:33:16 +02:00
Daniel Eklöf
6d58e50bba
PKGBUILD: bump tllist+fcft version dependencies 2020-04-24 20:32:56 +02:00
Daniel Eklöf
c82378863c
meson: dependency: use fallback without variable name
Now that both tllist and fcft use meson.override_dependency(), we can
use the simpler form of fallback in our dependency call().

This requires meson >= 0.53, tllist >= 1.0.1 and fcft >= 2.0.0
2020-04-24 20:32:37 +02:00
Daniel Eklöf
f736d467d9
fcft: fcft_glyph_for_wc() has been renamed to fcft_glyph_rasterize() 2020-04-24 10:53:34 +02:00
Daniel Eklöf
0b2006ecd5
term: fcft: max/space advance fields have been renamed 2020-04-23 11:54:03 +02:00
Daniel Eklöf
c5212694c1
meson: we now require fcft 2.0.x 2020-04-23 11:24:54 +02:00
Daniel Eklöf
144280ba17
changelog: current output's subpixel order is preferred over FontConfig 2020-04-22 20:00:31 +02:00
Daniel Eklöf
05bb0ae590
term: guess subpixel mode after initializing wayland window
At this point, we're not mapped, but we should have all the outputs
initialized. Which means we can at least guess which subpixel mode to
use.

If that turns out to be wrong, something we'll detect when we're
mapped, we'll just have to re-render.
2020-04-22 19:38:38 +02:00
Daniel Eklöf
7194f65ae9
fcft: adjust to fcft-2.0 API changes
* font_*() -> fcft_*()
* struct font -> struct fcft_font
* struct glyph -> struct fcft_glyph
* enum subpixel_order -> enum fcft_subpixel
2020-04-21 19:29:36 +02:00
Daniel Eklöf
e2c48c0c2e
Merge branch 'master' into fcft-v2 2020-04-21 19:03:11 +02:00
Daniel Eklöf
77af910330
main: log locale 2020-04-21 19:02:18 +02:00
Daniel Eklöf
6f83ef81e5
render: use output's subpixel mode when rasterizing glyphs 2020-04-20 18:38:55 +02:00
Daniel Eklöf
4ca6e760f2
completions: zsh: -f,--font accepts multiple, comma separated values 2020-04-20 18:38:33 +02:00
Daniel Eklöf
8a094b5683
readme: improve description 2020-04-19 16:23:18 +02:00
Daniel Eklöf
ee254e0de1
readme: bug reporting: emphasize that debug builds are preferred for backtraces 2020-04-19 16:01:29 +02:00
Daniel Eklöf
7971aeeda5
readme: spell 'change' correctly 2020-04-19 15:51:05 +02:00
Daniel Eklöf
5c4f5ab414
term: destroy: free scroll damage lists
These lists are typically empty when we destroy the terminal. However,
if we had queued up damage, and then manage to destroy the terminal
instance before the last changes were rendered, then they will *not*
be empty.

Found by the address sanitizer.
2020-04-19 15:26:52 +02:00
Daniel Eklöf
08485ce412
csi: fix typo - the '(' was in the wrong place 2020-04-19 14:52:14 +02:00
Daniel Eklöf
b7593897b7
render: search: improve handling of very long search strings 2020-04-19 14:50:48 +02:00
Daniel Eklöf
e93757198a
csi: CSI Ps ; Ps ; Ps t: report logical pixels 2020-04-18 23:20:09 +02:00
Daniel Eklöf
4f145bed33
shm: #ifdef conditional code to measure total size of SHM allocations 2020-04-18 12:24:40 +02:00
Daniel Eklöf
02edee78b2
server: don't do misaligned loads 2020-04-18 12:20:28 +02:00
Daniel Eklöf
544d8fe5f9
Merge branch 'csi-report' 2020-04-18 11:52:18 +02:00
Daniel Eklöf
fa8b0cbd80
csi: implement CSI Ps ; Ps ; Ps t reporting escape sequences
A lot of the escape sequences on the "CSI Ps ; Ps ; Ps t" form are
expected to return a reply. Thus, not having these implemented means
we will hang if the client sends these escapes.

Not all of these escapes can be meaningfully implemented on Wayland,
and thus this implementation is best effort.

We now support the following escapes:

* 11t   - report if window is iconified (always replies "no")
* 13t   - report window position (always replies 0,0)
* 13;2t - report text area position (replies with margins, since we
          cannot get the window's position)
* 14t   - report text area size, in pixels
* 14;2t - report window size, in pixels
* 15t   - report screen size, in pixels
* 16t   - report cell size, in pixels
* 18t   - report text area size, in cells
* 19t   - report screen size, in cells
2020-04-18 11:51:53 +02:00
Daniel Eklöf
842cd158d2
changelog: selection is no longer cleared on resize 2020-04-17 22:43:28 +02:00
Daniel Eklöf
761bf426dc
render: resize: no need to truncate selection anymore - it's being translated 2020-04-17 22:30:56 +02:00
Daniel Eklöf
7eb990c8b1
render: resize: need to translate selection coordinates
While it *looked* like the selection was working before, it really
wasn't.

When rendering, we're looking at the cells' attributes to determine
whether they have been selected or not.

When copying text however, we use the terminal's 'selection' state,
which consists of 'start' and 'end' coordinates.

These need to be translated when reflowing text.
2020-04-17 22:20:27 +02:00