Seen on plasma; monitor is turned off, and then back on again. Before
the "new" output global is emitted, the compositor calls
fractional_scale::preferred_scale().
This results in a call to get_font_dpi(), where we crash, since it
assumes there is at least one monitor available.
Fix by falling back to a DPI of 96.
Hopefully closes#1498
Previously, foot -a test wouldn't actually set the app ID if there was
no config file and the defaults were used, which was very
counterintuitive.
Now, load_config() will carry on until the end, even if there's no
config file, so overrides still work.
This implements private mode 2027 - grapheme cluster processing, as
defined in the "Terminal Unicode Core"[1] specification.
Internally, we just flip the already existing option "grapheme
shaping". Since it's now runtime changeable, we need a copy of it in
the terminal struct, rather than referencing the conf object.
[1]: 13fc5a8993/spec/terminal-unicode-core.tex (L50-L53)
When we receive an XTGETTCAP query, where the capability is not
correctly hex encoded, ignore it.
Before this patch, we echo:ed it back to the TTY inside an error
resonse.
Before this patch, the file://<host> prefix was stripped from URIs,
when the hostname matched the current host (that is, for "local"
URLs).
Unfortunately, the way this was done caused other parts of the URI to
be stripped as well. For example, the 'query' and 'fragment' parts.
This patch simply removes all special casing of file:// URIs.
Since the URL is passed to a generic opener (i.e. we don't have a
special opener application for file:// URIs), the opener helper must
handle the file:// prefix anyway.
Closes#1474
It's possible for token to be set when the compositor doesn't support
activation, and this caused a segfault. For example, this can happen
when overriding WAYLAND_DISPLAY to point to a compositor that doesn't
support activation, in a terminal running under one that does, and so
has set XDG_ACTIVATION_TOKEN.
This patch changes the default of triple clicking, from selecting the
current logical row, to first trying to select the contents of the
quote under the cursor, and if failing to find a quote, selecting the
current row (like before).
This is implemented by adding a new key binding, 'select-quote'.
It will search for surrounding quote characters, and if one is found
on each side of the cursor, the quote is selected. If not, the entire
row is selected instead.
Subsequent selection operations will behave as if the selection is
either a word selection (a quote was found), or a row selection (no
quote found).
Escaped quote characters are not supported: "foo \" bar" will match
'foo \', and not 'foo " bar'.
Mismatched quotes are not custom handled. They will simply not match.
Nested quotes ("123 'abc def' 456") are supported.
Closes#1364
Un-grabbed wheel events are now passed through the mouse binding
matching logic, instead of being hardcoded to scrolling the terminal
contents.
They are mappable through the BTN_BACK and BTN_FORWARD buttons.
Since they're not actually button *presses*, they never generate a
click count other than 1. This limitation is documented, but not
checked in the config. This means it's possible to create bindings
like "BTN_BACK+3" (i.e. triple "click"). They will however never
trigger.
The old, hardcoded logic is now accessible through the new
scrollback-up-mouse and scrollback-down-mouse mouse
bindings. They (obiously) default to BTN_BACK and BTN_FORWARD,
respectively.
Example usage: keep the default of scrolling terminal contents with
the wheel, when used without modifiers, but map Control+wheel to font
zoom in/out:
[mouse-bindings]
font-increase=Control+BTN_FORWARD
font-decrease=Control+BTN_BACK
(this also keeps the default key bindings to zoom in/out; ctrl-+ and
ctrl+-)
Closes#1077
No longer inhibits touch event handling when terminal window
has pointer focus. Instead, inhibit touch event when at least
one pointer button is held down.
This change improves user experience when using foot with both
a mouse and a touchscreen.
Closes#1428.
* Skip spacer cells. This fixes an issue where characters following a
double-width character weren't detect properly.
* Unpack grapheme clusters (i.e. cells with multiple codepoints), and
iterate all their codepoints.
Closes#1465
The foot window may, for various reasons, become completely
unmapped (that is, being removed from all outputs) at run time.
One example is wlroots based compositors; they unmap all other windows
when an opaque window is fullscreened.
21d99f8dce introduced a regression,
where instead of picking the scaling factor from one of the available
outputs (at random), we started falling back to '1' as soon as we were
unmapped.
This patch restores the original logic, but also improves upon it.
As soon as a scaling factor has been assigned to the window, we store
a copy of it in the term struct ('scale_before_unmap').
When unmapped, we check if it has a valid value (the only time it
doesn't is before the initial map). If so, we use it.
Only if it hasn't been set do we fall back to picking an output at
random, and using its scaling factor.
Closes#1464
This fixes services in Wayland session where WAYLAND_DISPLAY is only
imported into the systemd user instance environment after
graphical-session.target is reached (such as GNOME).
../vt.c:648:13: runtime error: signed integer overflow: 3924432811 * 2654435761 cannot be represented in type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../vt.c:648:13 in
Closes#1456
Rewrite render_osd(), and instead of passing in an y-offset, let
render_osd() itself center the text inside the OSD buffer.
This is done using the same baseline calculation term_font_baseline()
does, except we use the buffer height instead of the line height.
Note that most OSDs are sized based on the line height...
Closes#1430
Instead of special casing configuration affecting command line
options (like --font, --fullscreen, --maximized etc), translate them
to overrides, and let the configuration system handle them.
This also fixes an issue where -f,--font did not set csd.font, if
csd.font were otherwise unset.
../vt.c:648:13: runtime error: signed integer overflow: 3924432811 * 2654435761 cannot be represented in type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../vt.c:648:13 in
Closes#1456
Rewrite render_osd(), and instead of passing in an y-offset, let
render_osd() itself center the text inside the OSD buffer.
This is done using the same baseline calculation term_font_baseline()
does, except we use the buffer height instead of the line height.
Note that most OSDs are sized based on the line height...
Closes#1430
Instead of special casing configuration affecting command line
options (like --font, --fullscreen, --maximized etc), translate them
to overrides, and let the configuration system handle them.
This also fixes an issue where -f,--font did not set csd.font, if
csd.font were otherwise unset.
Before this patch, we didn’t ensure width and height were valid for
the current scaling factor, when fractional scaling _is_
available. That is, we didn’t ensure the width/height values
multiplied back to their original values after dividing with the
scaling factor.
Closes#1446
This function is only called directly when scaling the mouse
pointer. The mouse pointer is never guaranteed to have a valid width
and height, so skip the width/height assertions for it.
* Ensure buffer sizes are valid. That is, ensure that
size / scale * scale == size.
* Do size calculation of the window geometry in the same way we
calculate the CSD offsets.