Commit graph

5967 commits

Author SHA1 Message Date
Daniel Eklöf
b2963bbf80
changelog: crash when xdg token is set, but compositor does not support activation 2023-09-21 18:31:46 +02:00
Alyssa Ross
9257273d84
wayland: check activation supported before activating
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.
2023-09-21 06:59:48 +00:00
Sertonix
a4843ef418 doc: keybings default none 2023-09-20 13:20:48 +00:00
Daniel Eklöf
1719ff93a7
selection: add support for selecting the contents of a quote
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
2023-09-19 16:23:34 +02:00
Daniel Eklöf
fe7aa25ad8
input: make wheel events mappable
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
2023-09-18 16:36:39 +02:00
CismonX
f0f0d02bf7
input: improve touch handling on pointer presense
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.
2023-08-24 00:45:20 +08:00
Daniel Eklöf
4f3f614457
url-mode: handle wide chars and grapheme clusters when auto-detecting URLs
* 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
2023-08-21 16:26:18 +02:00
raggedmyth
482a032d1a
add panda theme 2023-08-19 08:03:54 +02:00
Daniel Eklöf
86ef638102
term: improve fallback logic when selecting scaling factor while unmapped
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
2023-08-18 16:48:18 +02:00
Daniel Eklöf
50a28fe1e8
ci: replace 'pipeline' with 'steps'
Hopefully fixes:

  failed to parse pipeline: "pipeline:" got removed, use "steps:" instead
2023-08-18 16:46:09 +02:00
Daniel Eklöf
95bce2b20c
Merge branch 'systemd-service-ordering'
Closes #1436
2023-08-11 16:41:11 +02:00
Max Gautier
f1075377d3
changelog: systemd units in GNOME 2023-08-10 11:38:08 +02:00
Max Gautier
be4797d619
systemd: skip foot-server.service when not in a Wayland context 2023-08-10 11:29:08 +02:00
Max Gautier
14ea4322fe
Order the systemd services after graphical-session.target
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).
2023-08-10 11:29:06 +02:00
Daniel Eklöf
34520aa16e
meson: allow building with wayland-protocols as a subproject 2023-08-08 19:32:45 +02:00
Daniel Eklöf
1faad5add7
Merge branch 'wayland-protocols-1.32'
Closes #1391
2023-08-07 16:53:58 +02:00
Daniel Eklöf
698c5b54f3
wayland: cursor-shape-v1 is now always available
Since we're requiring wayland-protocols >= 1.32
2023-08-07 16:53:19 +02:00
Daniel Eklöf
7eee415b75
wayland: fractional-scale-v1 is now always available
Since we're requiring wayland-protocols >= 1.32
2023-08-07 16:53:19 +02:00
Daniel Eklöf
d59a4e7a77
wayland: xdg-activation is now always available
Since we're requiring wayland-protocols >= 1.32
2023-08-07 16:53:19 +02:00
Daniel Eklöf
e0475a5421
meson: require wayland-protocols >= 1.32 2023-08-07 16:53:19 +02:00
Daniel Eklöf
becd8ed049
Merge branch 'releases/1.15' 2023-08-07 16:44:24 +02:00
Daniel Eklöf
f314699945
meson: bump version to 1.15.3 2023-08-07 16:39:54 +02:00
Daniel Eklöf
341a5eeefd
changelog: prepare for 1.15.3 2023-08-07 16:39:42 +02:00
Daniel Eklöf
5334e3d1aa
main: “title%s” -> “title=%s”
Fix regression of --title,-T option. This broken when command line
parsing was switched to using overrides, in
0b4f1b4af2.

Closes #1457
2023-08-07 16:38:06 +02:00
Daniel Eklöf
d00a2a222e
vt: fix ASAN UB warning
../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
2023-08-07 16:38:04 +02:00
Daniel Eklöf
a3d54614c7
render: OSD: center text vertically
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
2023-08-07 16:38:03 +02:00
Daniel Eklöf
e567250449
main: translate command line options to overrides
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.
2023-08-07 16:37:59 +02:00
Daniel Eklöf
e1d66ad0c1
changelog: add new ‘unreleased section’ 2023-08-07 16:37:46 +02:00
Daniel Eklöf
eea21070ee
changelog: “config” -> “config option” 2023-08-05 07:25:36 +02:00
Daniel Eklöf
be22736f23
main: “title%s” -> “title=%s”
Fix regression of --title,-T option. This broken when command line
parsing was switched to using overrides, in
0b4f1b4af2.

Closes #1457
2023-08-05 07:23:11 +02:00
Daniel Eklöf
12e0edd6e1
vt: fix ASAN UB warning
../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
2023-08-05 07:19:51 +02:00
Daniel Eklöf
90ad3d6491
render: OSD: center text vertically
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
2023-07-31 16:48:49 +02:00
Daniel Eklöf
ddcbf2a7b4
config: remove deprecated option 'utempter' 2023-07-31 16:47:51 +02:00
Daniel Eklöf
0b4f1b4af2
main: translate command line options to overrides
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.
2023-07-31 16:26:17 +02:00
Daniel Eklöf
33dcb4d49a
changelog: add new ‘unreleased section’ 2023-07-30 13:27:42 +02:00
Daniel Eklöf
8aa61ef45c
Merge branch 'releases/1.15' 2023-07-30 13:27:16 +02:00
Daniel Eklöf
53a5d62e5a
meson: bump version to 1.15.2 2023-07-30 13:18:55 +02:00
Daniel Eklöf
3111bc89e5
changelog: prepare for 1.15.2 2023-07-30 13:18:41 +02:00
Daniel Eklöf
89d0fe561f
Merge branch 'master' into releases/1.15 2023-07-30 13:17:31 +02:00
Daniel Eklöf
1af0277564
--window-size-chars: ensure width/height are valid for current scaling factor
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
2023-07-30 07:53:33 +02:00
Daniel Eklöf
05131a9b0c
Merge branch 'csd-fractional-scaling'
Closes #1441
2023-07-29 09:10:56 +02:00
Daniel Eklöf
aea687c0a1
changelog: CSDs with fractional scaling 2023-07-29 09:09:59 +02:00
Daniel Eklöf
764248bb0d
wayl_surface_scale_explicit_width_height(): don’t assert width/height are valid for scale
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.
2023-07-29 08:18:00 +02:00
Daniel Eklöf
1782474481
fractional scaling: another round(!) of rounding fixes
* 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.
2023-07-28 16:03:13 +02:00
Daniel Eklöf
753c4b5d4f
render: round scaled border/title/button widths
And calculation of compounded offsets/widths/heights, to compensate
for compositor rounding when positioning and scaling/sizing
subsurfaces.

Closes #1441
2023-07-28 16:03:08 +02:00
Daniel Eklöf
9d75c55146
wayland: don't try to use a non-existing viewporter interface
When instantiating the viewport for a pointer surface, we didn't first
check if the compositor implements the viewporter interface.

This triggered a crash when a) foot was compiled with fractional
scaling, and b) the compositor did not implement the viewporter
interface.

Closes #1444
2023-07-28 15:42:28 +02:00
Daniel Eklöf
139fd6d55c
meson: add -Dterminfo-base-name option
This defines the base name of the generated terminfo files. It
defaults to the value of -Ddefault-terminfo (i.e. 'foot')

Example:

  meson -Ddefault-terminfo=foot-bananas -Dterminfo-base-name=foot-apples

The generated terminfo files will be

* terminfo/f/foot-apples
* terminfo/f/foot-apples-direct

The default value of $TERM will be 'foot-bananas'
2023-07-28 15:40:53 +02:00
Daniel Eklöf
f3c5b82c82
config: add tweak.bold-text-in-bright-amount
By how much to increase the luminance when brightening bold
fonts. This was previously hard-coded to a factor of 1.3, which is now
the default value of the new config option.

Closes #1434
2023-07-28 15:40:07 +02:00
Daniel Eklöf
e912656682
render: revert part of a36f67cbe3
render_osd() shouldn't use term_font_baseline().

This is because term_font_baseline() uses the line height to determine
the position, while render_osd() renders to surfaces that aren't sized
like the grid.

This fixes a regression, where the CSD title were sometimes rendered
too high up, and sometimes too low.
2023-07-28 15:37:48 +02:00
Daniel Eklöf
fd813d0e6c
font baseline: use max(font->height, font->ascent + font->descent) when calculating font height
This is how it's done when calculating the cell height, and we should
do the same thing when calculating the font baseline.
2023-07-28 15:36:48 +02:00