Commit graph

6426 commits

Author SHA1 Message Date
Daniel Eklöf
e1469ed057
Merge branch 'releases/1.19' 2024-10-23 13:54:49 +02:00
Daniel Eklöf
cb91fbb4b6
meson: bump version to 1.19.0 2024-10-23 13:51:15 +02:00
Daniel Eklöf
6d11e93e2f
changelog: prepare for 1.19.0 2024-10-23 13:50:54 +02:00
Daniel Eklöf
d68da27a7f
uri: skip query/fragment parsing when dealing with file:// URIs
Also, ignore invalid query/fragments (i.e. if the fragment comes
before the query).

Closes #1840
2024-10-23 08:47:21 +02:00
Daniel Eklöf
996e5fa630
Revert "url-mode: don't strip the file:// prefix from localhost URIs"
This reverts commit 54722369d8.
2024-10-23 08:46:30 +02:00
Daniel Eklöf
511aad419b
config: add color.sixelN options
These options allows you to configure the default sixel color palette.
2024-10-23 08:35:30 +02:00
Daniel Eklöf
e891abdd6a
render: remove unnecessary call to wl_surface_damage_buffer()
The damage region(s) are translated to wl_surface_damage_buffer()
calls after the entire frame has been rendered.
2024-10-06 11:26:35 +02:00
Daniel Eklöf
ce38f5b413
render: sixels: update damage region when rendering sixels
This fixes flickering when foot is forced to double-buffer (e.g when
running under KDE, or smithay based compositors).

Since the damage region isn't updated, the sixel images aren't
included in the memcpy that is done to transfer the last frame's
updated regions to the next frame.

As a result, every other frame will have the sixels, while the others
don't.

Closes #1851
2024-10-05 08:55:48 +02:00
Daniel Eklöf
4afb94687c
changelog: #1715: "ghost" lines when selecting text 2024-09-21 09:17:38 +02:00
Daniel Eklöf
6ad84dab2d
render: do dirty/clean consistency check before rendering sixels
Since the sixels may render some of the cells, we want the check to
happen before the sixels.
2024-09-21 09:11:28 +02:00
Daniel Eklöf
49ed8b5e21
selection: set row->dirty when clearing the cell->attrs.clean bit
Closes #1715
2024-09-21 09:11:07 +02:00
Daniel Eklöf
798b44934f
render: double-buffer: optimization: skip clean rows
When scanning the grid for all-dirty rows (that we can remove from the
damage region we're about to memcpy from the old frame), check the
row->dirty bit, and skip scanning the cells of that row altogether.

We're only looking for rows where all cells are dirty - those rows can
be removed from the region we copy from the old frame, since the
entire row will be re-rendered anyway.

If a row is clean, it *must* be copied from the old frame.
2024-09-21 09:11:07 +02:00
Daniel Eklöf
a9fefcf58b
render: (debug): assert row->dirty vs. cell->attrs.clean consistency 2024-09-21 09:11:07 +02:00
Daniel Eklöf
046d959657
shm: fix compilation when FORCED_DOUBLE_BUFFERING is enabled 2024-09-21 09:11:07 +02:00
Daniel Eklöf
e2aeb7f336
render: xcursor_is_valid(): don't crash when there's no theme loaded
When trying to set a custom cursor shape, we first validate it. This
is done by checking against known server-side names, and then trying
to load the cursor from the client side cursor theme.

But, if we're using server side names, there is no theme loaded, and
foot crashed.

Fix by checking if we have a theme loaded, and if not, fail the cursor
shape name validation.
2024-09-21 09:10:48 +02:00
Daniel Eklöf
297cb370aa
render: add missing include, limits.h 2024-09-15 09:56:41 +02:00
Daniel Eklöf
33f3818520
Merge branch 'toplevel-icon' 2024-09-13 09:20:50 +02:00
Daniel Eklöf
76b58b5663
changelog: remove escape sequences we've reverted 2024-09-13 09:04:18 +02:00
Daniel Eklöf
9151685d04
csi: revert implementation of CSI 20 t 2024-09-13 09:04:18 +02:00
Daniel Eklöf
7984f08925
osc: OSC-1 does not set the icon, it sets the icon _label_
In fact, there appears there *is* no escape sequence to set the icon.

Keep most of the logic in place, but in practice, we'll always set the
icon to the app-id. That is, at startup, we set it to the configured
app-id (either from config, or the command line).

OSC-176, which sets the app-id, also updates the icon (to the app-id).
2024-09-13 09:04:18 +02:00
Daniel Eklöf
c6208a98c8
main: include toplevel-icon support in --version output 2024-09-13 09:04:18 +02:00
Daniel Eklöf
f5caa2d265
pgo: add missing stub for render_refresh_icon() 2024-09-13 09:04:18 +02:00
Daniel Eklöf
97ec375c67
toplevel-icon: implement OSC-1, CSI 20/21/22/23 t
* The toplevel icon is now set to the app-id, unless "overridden" by
  OSC-1 or OSC-0.
* Implemented OSC-1
* OSC-0 extended to also set the icon
* Implemented CSI 20 t - report window icon
* Implemented CSI 21 t - report window title
* Implemented CSI 22 ; 1 t - push window icon
* Implemented CS 23 ; 1 t - pop window icon
* Extended CSI 22/23 ; 0 t to also push/pop the icon
* Verify app-id set by OSC-176 is valid UTF-8
* Verify icon set by OSC-0/1 is valid UTF-8
2024-09-13 09:04:17 +02:00
Daniel Eklöf
3f8a1fc85b
changelog: xdg-toplevel-icon-v1 2024-09-13 09:04:17 +02:00
Daniel Eklöf
b34137dde3
toplevel-icon: set to app-id, instead of hardcoding to "foot"
And, special case "footclient", and map it to "foot".
2024-09-13 09:04:17 +02:00
Daniel Eklöf
0cb07027f2
wayland: set toplevel icon
If the xdg-toplevel-icon-v1 protocol is available, and we have the
corresponding manager global, set the toplevel icon to "foot".

Note: we do *not* provide any pixel data. This is by design; we want
to keep things simple.

To be able to provide pixel data, we would have to either:

* embed the raw pixel data in the foot binary
* link against either libpng or/and e.g. nanosvg, locate, at run-time,
  the paths to our own icons, and load them at run-time.
* link against either libpng or/and e.g. nanosvg, and, at run-time, do
  a full icon lookup. This would also require us to add a config option
  for which icon theme to use.

Of the two, I would prefer the first option. But, let's skip this
completely for now.

By providing the icon as a name, the compositor will have to lookup
the icon itself. Compositors supporting icons is likely to already
support this.

So what do we gain by implementing this protocol? Compositors no
longer has to parse .desktop files and map our app-id to find the icon
to use.

There's one question remaining. With this patch, the icon name is
hardcoded to "foot", just like our .desktop files. But, perhaps we
should use the app-id instead? And if so, should we also change the
icon when the app-id changes?

My gut feeling is, yes, we should use the app-id instead, and yes, we
should update the icon when the app-id is changed at run-time.
2024-09-13 09:04:17 +02:00
Daniel Eklöf
28a1c67dd5
wayland: bind the xdg-toplevel-icon manager global 2024-09-13 09:04:17 +02:00
Daniel Eklöf
5ef69fc591
meson: detect wayland-protocols >= 1.37, and conditionally enable xdg-toplevel-icon-v1 2024-09-13 09:04:17 +02:00
Craig Barnes
d4a1283797
xsnprintf: various improvements related to xvsnprintf() and xsnprintf()
Summary of changes:

* Make xvsnprintf() static
* restrict-qualify pointer arguments (as done by the libc equivalents)
* Make comments and spec references more thorough
* Remove pointless `n <= INT_MAX` assertion (see comment)
* Use FATAL_ERROR() instead of xassert() (since the assertion is inside
  a shared util function but the caller is responsible for ensuring the
  condition holds true)
* Change some callers to use size_t instead of int for the return value
  (negative returns are impossible and all subsequent uses are size_t)

The updated comments and code were taken (and adapted) from:

49260bb154/src/util/xsnprintf.c (L6-50)

This work was entirely authored by me and I hereby license this
contribution under the MIT license (stated explicitly, so that
there's no ambiguity w.r.t. the original license).
2024-09-13 09:01:15 +02:00
Craig Barnes
31f88e636c readme: typo: foot-ctlseq -> foot-ctlseqs 2024-09-11 22:08:45 +01:00
Daniel Eklöf
1925593a37
render: resize(): don't overflow the number of scrollback lines
The config system allows setting the scrollback lines to
2**32-1.

However, the total number of grid lines is the scrollback lines plus
the window size, and then rounded *up* to the nearest power of two.

Furthermore, the number of rows is represented with a plain 'int'
throughout the code base.

The largest positive integer that fits in an int is 2**31-1. That
however, is not a power of two.

The largest positive integer, that also is a power of two, that fits
in an int is 2**30, or 1073741824.

Ideally, we'd just cast the line count to a 64-bit integer, and call
__builtin_clzl{,l}() on it, and then take the smallest value of that,
or 2**30. But, for some reason, __builtin_clzl(), and
__builtin_clzll() appears to ignore bits above 32, despite they being
typed to long and long long. Bug?

Instead, ensure we never call __builtin_clz() on anything larger than
2**30.

Closes #1828
2024-09-09 06:58:52 +02:00
Daniel Eklöf
8a4bbbf5cb
readme: update mastodon link 2024-09-08 13:45:20 +02:00
Daniel Eklöf
c8185aec1d
desktop: rename to foot{,client,-server}.desktop
That is, skip the reverse DNS naming scheme suggested by the .desktop
specification, and directly match our app-ids ("foot", and
"footclient").

This simplifies .desktop -> window instance mapping, allowing DEs to
match the filenames directly, without having to look at the
StartupWMClass key in the .desktop files.

These are the original names of the .desktop files. There were
renamed (to use the reverse DNS syntax) to please the flathub people,
who *required* this scheme to accept the foot package.

But, since:

* We don't package foot ourselves
* We don't go out of our way to support non-distro packaging schemes
* Flathub still hasn't merged the foot PR (it's now 2 years old)
* There are no know issues in any known DE that prevents a non-reverse
  DNS .desktop filename from working
* There are plenty of other applications that doesn't use reverse DNS
  names (a very clear majority, in my case)

Let's just revert back to the simpler naming scheme.

Closes #1607
2024-09-08 13:06:27 +02:00
Daniel Eklöf
11ff9ba7ec
.desktop: remove StartupWMClass cludge 2024-09-08 10:22:29 +02:00
Daniel Eklöf
a916a6a8ca
metainfo: add recent releases, update feature list 2024-09-08 10:21:28 +02:00
Daniel Eklöf
c41f55c3a0
sixel: default bg color is now taken from the sixel palette, not the ANSI bg color
The wording in the original VT340 documentation is vague:

    Pixel positions specified as 0 are set to the current background
    color.

What does that mean? We _thought_ it meant the current ANSI background
color, as set with e.g. CSI 4x m.

It's still all a bit vague, but seeing that we have separate palettes
for text and graphic (should we?), it doesn't make sense to use the
ANSI background color as the default sixel background color.

So, use entry 0 from the sixel palette instead.
2024-09-05 07:33:05 +02:00
Daniel Eklöf
c5bb1fb2ed
notifications: BEL and OSC-777 now focuses the window on notification activation
Or put more propertly; if the notification daemon, and the
notification helper used by foot has been configured
properly (i.e. they both support XDG activation tokens), notifications
generated by BEL and OSC-777 will now raise/focus the window when the
default action of the notification is activated - typically by
clicking the notification.

Closes #1822
2024-09-05 07:16:15 +02:00
Daniel Eklöf
c15ebbfa2e
changelog: strikeout-thickness 2024-08-26 19:36:26 +02:00
Oleh Hushchenkov
b47a4dd255
add setting for strikeout thickness 2024-08-26 19:34:47 +02:00
Daniel Eklöf
01fa59b6b7
changelog: mbsntoc32() failure checks 2024-08-20 07:17:58 +02:00
Daniel Eklöf
8f9f3dbd9d
term_set_window_title(): fix bad check for invalid UTF-8
mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1.
2024-08-20 07:15:22 +02:00
Daniel Eklöf
7dd204fd31
osc: notify: fix bad check for invalid UTF-8
mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1.
2024-08-20 07:14:53 +02:00
Daniel Eklöf
be13788a4f
changelog: resize-keep-grid 2024-08-20 07:12:19 +02:00
Daniel Eklöf
b3fd994fd3
changelog: add missing reference to #1787 2024-08-20 07:12:09 +02:00
Andrew J. Hesford
1969717527
feature: add resize-keep-grid to allow text reflow on font changes 2024-08-20 07:07:29 +02:00
tokyo4j
a2fc2a986e
render: follow cursor.unfocused-style regardless of cursor.style
Before this commit, cursor.unfocused-style was effective only with
cursor.style=block
2024-08-20 06:59:33 +02:00
Daniel Eklöf
96c30cd410
term: thrd_join() returns thrd_success on success, not 0
Closes #1812
2024-08-15 17:20:12 +02:00
Daniel Eklöf
dc5ff7db28
changelog: add new 'unreleased' section 2024-08-14 12:02:56 +02:00
Daniel Eklöf
4cd65f0e70
Merge branch 'releases/1.18' 2024-08-14 12:02:36 +02:00
Daniel Eklöf
ce9c9f6be6
meson: bump version to 1.18.1 2024-08-14 12:00:20 +02:00