Commit graph

1041 commits

Author SHA1 Message Date
Daniel Eklöf
becd8ed049
Merge branch 'releases/1.15' 2023-08-07 16:44:24 +02:00
Daniel Eklöf
341a5eeefd
changelog: prepare for 1.15.3 2023-08-07 16:39:42 +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
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
3111bc89e5
changelog: prepare for 1.15.2 2023-07-30 13:18:41 +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
aea687c0a1
changelog: CSDs with fractional scaling 2023-07-29 09:09:59 +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
a36f67cbe3
render: apply new baseline calculation everywhere
* URL jump labels
* Scrollback position indicator
* Line/box drawings characters

Closes #1430
2023-07-25 15:53:29 +02:00
Daniel Eklöf
0a61cfc3be
wayland: update terminals (fonts etc) on xdg_output_handle_done()
Monitor DPI depends on information from both the wl_output and the
xdg_output interfaces.

Before this patch, terminals were only updated after changes to the
wl_output interfaces (thus depending on xdg output changes being
pushed by the compositor before wl_output changes).

That assumption (xdg_output happening before wl_output) isn’t always
true.

This patch fixes the issue by updating the terminals in the
xdg_output’s “done” event.

Closes #1431
2023-07-23 20:12:13 +02:00
Daniel Eklöf
8223b4b76c
changelog: ignore invalid UTF-8 in input 2023-07-22 11:23:22 +02:00
Daniel Eklöf
15d7885c78
changelog: add new ‘unreleased’ section 2023-07-21 09:00:57 +02:00
Daniel Eklöf
fa97df0eab
changelog: prepare for 1.15.1 2023-07-21 08:56:49 +02:00
Daniel Eklöf
b3255465f1
render: change baseline calculation, to center it within the line
Before this patch, fonts were anchored to the top of the line. With
this patch, it is instead centered.

Closes #1302
2023-07-21 08:17:32 +02:00
Max Gautier
478474d0ce
Changelog: standard system target + footclient fallback 2023-07-21 08:13:36 +02:00
Daniel Eklöf
a49281ced3
render: OSD: don’t mark surface as being opaque, when it’s not 2023-07-19 16:43:18 +02:00
Daniel Eklöf
899b768b74
render: disable transparency when we’re fullscreened
The wayland protocol recommends (or mandates?) that compositors render
a black background behind fullscreened transparent windows. I.e. you
never see what’s _actually_ behind the window.

So, if you have a white, but semi-transparent background in foot,
it’ll be rendered in a shade of gray.

Given this, it’s better to simply disable transparency while we’re
fullscreened. That way, we at least get the "correct" background
color.

Closes #1416
2023-07-19 16:42:41 +02:00
Daniel Eklöf
648f6016e3
changelog: spelling: sacling -> scaling 2023-07-19 16:37:25 +02:00
Daniel Eklöf
fdd753263b
term: destroy: unref key bindings *after* destroying window
This fixes a crash-on-exit on compositors that emit a _"keyboard
leave"_ event when a surface is unmapped.

In our case, destroying the window (where we unmap it) in
term_destroy(), lead to a crash in term_mouse_grabbed(), due to
key_binding_for() returning NULL.

The call chain in this is case is, roughly:

  term_destroy() ->
  wayl_win_destroy() ->
  keyboard_leave() ->
  term_xcursor_update_for_seat() ->
  term_mouse_grabbed()
2023-07-18 18:26:28 +02:00
Daniel Eklöf
27b4c2ac2d
themes: starlight: update to V4
This also updates the default theme in foot, as well as the
documentation.

Closes #1409
2023-07-18 16:20:33 +02:00
Daniel Eklöf
023a1b8da6
changelog: crash on pointer capability loss 2023-07-18 16:12:43 +02:00
Daniel Eklöf
df96b7f4c0
changelog: wrong DPI, and wrong initial font size with fractional scaling 2023-07-18 05:48:21 +02:00
Daniel Eklöf
5b3b89cb64
changelog: monitor metadata is now picked from the one we were last mapped on 2023-07-18 05:48:02 +02:00
Daniel Eklöf
6de69aa9b7
render: fix xcursor scaling with fractional-scale-v1
This worked just after the fractional-scaling branch was merged, but
was then broken by the cursor-shape branch, due to a bad rebase of
that branch.
2023-07-18 05:44:17 +02:00
Ronan Pigott
b7100d5716 render: use rounding for fractional scale
If we truncate the buffer dimensions we may accidentally submit a
buffer with inappropriate size.
2023-07-15 20:03:16 -07:00
Daniel Eklöf
d1df98e0ca
changelog: add new ‘unreleased’ section 2023-07-14 12:40:55 +02:00
Daniel Eklöf
53b0eb8e1b
changelog: prepare for 1.15.0 2023-07-14 12:25:16 +02:00
Daniel Eklöf
3f7be59062
config: add csd.double-click-to-maximize=no|yes option
When enabled, double-clicking the CSD titlebar will (un)maximize the
window.

Defaults to ‘yes’ (since this is the old hard-coded behavior).

Closes #1293
2023-07-14 12:03:35 +02:00
Daniel Eklöf
efc619b0af
config: make ‘starlight’ the default color theme
Closes #1321
2023-07-14 10:11:43 +02:00
Daniel Eklöf
b3745b31c7
render: don’t invert cursor colors when custom colors are being used
When the user has configured custom cursor colors (cursor.color is set
in foot.ini), don’t invert those colors when the cell is either
selected, or has the ‘reverse’ attribute set.

This aligns foot’s behavior with Alacritty, Kitty and Wezterm. Contour
also behaves similarly, except mouse selections override the cursor
colors (turning the cursor invisible).

Closes #1347
2023-07-14 09:57:10 +02:00
Daniel Eklöf
3609017c38
changelog: mention the new default key binding for show-urls-launch under “fixed”
It “fixes” the key binding conflict seen on e.g. GNOME, and increases
the exposure of the change to, hopefully, more users.
2023-07-10 12:42:36 +02:00
Daniel Eklöf
58898c0633
changelog: split up key binding changes for show-urls-launch and unicode-input 2023-07-10 12:42:10 +02:00
Antoine Beaupré
080a11eb73
bind control-shift-u to unicode-input, move urls to o
Having a keybinding to invoke arbitrary unicode characters is very
useful. It's often used as a method of last resort to communicate with
people outside of your main language. For example, if you want to type
the last letter of my real name, you can invoke the latin-1 character
0xe9 or unicode 0x00e9.

You can also use this to type special characters, for example, unicode
U+1F4A9 is of course, the infamous PILE OF POO, which is sure to
produce million laughs everywhere you go.

In foot, there's no keybinding by default to invoke the very useful
unicode-input command. There is no "standard" (as in "ISO") keybinding
this either. But there *is* a de-facto standard currently deployed
by *both* GTK and Qt (a rare feat) *and* Chrome OS (an even rarer
feat) and it's control-shift-u.

Alternatives include Control-x 8 (emacs), Control V u (vim),
Alt (Windows, LibreOffice), or Option (Mac). I doubt we want to adopt
any of those.

So let's use control-shift-u for this. Unfortunately, it's currently
assigned to show-urls-launch, which is unfortunate, but
insurmountable. We can reassign this keybinding elsewhere. I have
picked control-shift-o in my configuration, because "o" is a good
mnemonic for "open URLs". Others have suggested "m" instead.

Closes: #1183
2023-07-10 12:31:51 +02:00
CismonX
d2fcb5343f
input: add basic support for touchscreen input
Closes #517
2023-07-05 16:22:28 +02:00
Daniel Eklöf
4a73828911
changelog: fractional-scaling-v1 -> fractional-scale-v1 2023-07-04 08:38:07 +02:00
Daniel Eklöf
c8e13ad393
cursor-shape: add support for server side cursor shapes
This implements support for the new cursor-shape-v1 protocol. When
available, we use it, instead of client-side cursor surfaces, to
select the xcursor shape.

Note that we still need to keep client side pointers, for:

* backward compatibility
* to be able to "hide" the cursor

Closes #1379
2023-07-03 14:36:32 +02:00
Daniel Eklöf
49fb0cf359
sixel: re-scale images when the cell dimensions change
Before this patch, when the cell dimensions changed (i.e. when the
font size changes), sixel images were either removed (the new cell
dimensions are smaller than the old), or simply kept at their original
size (new cell dimensions are larger).

With this patch, sixels are instead resized. This means a
sixel *always* occupies the same number of rows and columns,
regardless of how much the font size is changed.

This is done by maintaining two sets of image data and pixman images,
as well as their dimensions. These two sets are the new ‘original’ and
‘scaled’ members of the sixel struct.

The "top-level" pixman image pointer, and the ‘width’ and ‘height’
members either point to the "original", or the "scaled" version.

They are invalidated as soon as the cell dimensions change. They, and
the ‘scaled’ image is updated on-demand (when we need to render a
sixel).

Note that the ‘scaled’ image is always NULL when the current cell
dimensions matches the ones used when emitting the sixel (to save
run-time memory).

Closes #1383
2023-06-30 08:29:35 +02:00
Daniel Eklöf
27a92b1158
changelog: dpi-aware’s default value is now ‘no’ 2023-06-29 15:38:23 +02:00
Daniel Eklöf
32b8c5c9b6
changelog: mention the newly added support for fractional-scaling-v1 2023-06-29 15:38:23 +02:00
Daniel Eklöf
774570ec41
sixel: stop cropping images to the last non-transparent row 2023-06-24 07:31:08 +02:00
Daniel Eklöf
d6d143e2a6
sixel: respect sixel aspect ratio
That is, parse P1 when initializing a new sixel, and don’t ignore
pad/pad in the raster attributes command.

The default aspect ratio is 2:1, but most sixels will override it in
the raster attributes command (to 1:1).
2023-06-24 07:31:08 +02:00
Daniel Eklöf
66d9b8da60
sixel: fix cursor positioning logic
This adjusts the logic that positions the text cursor after emitting a
sixel, when sixel scrolling mode is *enabled*.

We’ve always mimicked XTerm’s behavior. However, XTerm recently
changed its behavior, to better match that of an VT382.

Now, the cursor is placed *on* the last row of the sixel, instead of
on a new row after the sixel.

This allows applications to print sixels to the bottom row of the
terminal, without causing the content to scroll.

Finally, there was a bug in the horizontal positioning of the cursor;
it was placed on the *first* column of the row, instead of on the
first column of the sixel.
2023-06-24 07:31:02 +02:00