<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch 1.13.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.13.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.13.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-08-04T12:23:03Z</updated>
<entry>
<title>Add support for xdg_toplevel.wm_capabilities</title>
<updated>2022-08-04T12:23:03Z</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2022-05-06T18:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=129e1a9b8e23007026d19c970941ccbc8ee2f0ca'/>
<id>urn:sha1:129e1a9b8e23007026d19c970941ccbc8ee2f0ca</id>
<content type='text'>
See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/122
</content>
</entry>
<entry>
<title>Add no-op xdg_toplevel.configure_bounds handler</title>
<updated>2022-08-03T11:50:13Z</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2022-05-06T18:03:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2f68b421bfc444c2a713d7418850b67a7e34810f'/>
<id>urn:sha1:2f68b421bfc444c2a713d7418850b67a7e34810f</id>
<content type='text'>
Next commit uses v5.
</content>
</entry>
<entry>
<title>wayland: log human readable SHM format names in debug builds</title>
<updated>2022-06-20T16:58:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-06-16T16:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fabffd626b6bdeed624c0980f36283a902b2f864'/>
<id>urn:sha1:fabffd626b6bdeed624c0980f36283a902b2f864</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: throttle xdg activation token requests for window urgency</title>
<updated>2022-05-11T19:17:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-05-11T19:17:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=200c5cbc7913f3c9aca45792669c7ede2d087a47'/>
<id>urn:sha1:200c5cbc7913f3c9aca45792669c7ede2d087a47</id>
<content type='text'>
When XDG activation support was added to URL mode, we introduced a
regression, where it is possible to flood the Wayland socket with XDG
activation token requests.

Start foot with “foot -o bell.urgency=yes”, then run:

  while true; do echo -en ‘\a’; done

Finally, switch keyboard focus to another window. Foot crashes.

Throttle the token requests by limiting the number of outstanding
urgency token requests to 1.

Closes #1065
</content>
</entry>
<entry>
<title>url-mode: add support for XDG activation when opening URLs</title>
<updated>2022-05-05T08:02:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-05-03T17:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ea1aac88db3a6d9f368406676c3e5a0cedcafd57'/>
<id>urn:sha1:ea1aac88db3a6d9f368406676c3e5a0cedcafd57</id>
<content type='text'>
First, add a ‘token’ argument to spawn(). When non-NULL, spawn() will
set the ‘XDG_ACTIVATION_TOKEN’ environment variable in the forked
process. If DISPLAY is non-NULL, we also set DESKTOP_STARTUP_ID, for
compatibility with X11 applications. Note that failing to set either
of these environment variables are considered non-fatal - i.e. we
ignore failures.

Next, add a helper function, wayl_get_activation_token(), to generate
an XDG activation token, and call a user-provided callback when it’s
‘done (since token generation is asynchronous). This function takes an
optional ‘seat’ and ‘serial’ arguments - when both are non-NULL/zero,
we set the serial on the token. ‘win’ is a required argument, used to
set the surface on the token.

Re-write wayl_win_set_urgent() to use the new helper function.

Finally, rewrite activate_url() to first try to get an activation
token (and spawn the URL launcher in the token callback). If that
fails, or if we don’t have XDG activation support, spawn the URL
launcher immediately (like before this patch).

Closes #1058
</content>
</entry>
<entry>
<title>wayland: refactor: remove ‘struct config’ pointer from wayland struct</title>
<updated>2022-04-17T14:34:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T14:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed'/>
<id>urn:sha1:24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed</id>
<content type='text'>
The global config doesn’t necessarily reflect the correct
configuration to use - we should *always* use the current terminal
instance’s conf pointer.

* Move selection override modifier mask to the key_binding_set struct
* Always warn if XDG activation is unavailable, not just if
  bell.urgent is set (we no longer have access to this information)
* Pass ‘bool presentation_timings’ as a parameter to wayl_init()
* Remove ‘presentation_timings’ member from the ‘terminal’ struct

Closes #932
</content>
</entry>
<entry>
<title>key-binding: new API, for handling sets of key bindings</title>
<updated>2022-04-17T13:39:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T13:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=90a2ca966f657e5fdd82997aad9663e9984f3cc9'/>
<id>urn:sha1:90a2ca966f657e5fdd82997aad9663e9984f3cc9</id>
<content type='text'>
Up until now, our Wayland seats have been tracking key bindings. This
makes sense, since the seat’s keymap determines how the key bindings
are resolved.

However, tying bindings to the seat/keymap alone isn’t enough, since
we also depend on the current configuration (i.e. user settings) when
resolving a key binding.

This means configurations that doesn’t match the wayland object’s
configuration, currently don’t resolve key bindings correctly. This
applies to footclients where the user has overridden key bindings on
the command line (e.g. --override key-bindings.foo=bar).

Thus, to correctly resolve key bindings, each set of key bindings must
be tied *both* to a seat/keymap, *and* a configuration.

This patch introduces a key-binding manager, with an API to
add/remove/lookup, and load/unload keymaps from sets of key bindings.

In the API, sets are tied to a seat and terminal instance, since this
makes the most sense (we need to instantiate, or incref a set whenever
a new terminal instance is created). Internally, the set is tied to a
seat and the terminal’s configuration.

Sets are *added* when a new seat is added, and when a new terminal
instance is created. Since there can only be one instance of each
seat, sets are always removed when a seat is removed.

Terminals on the other hand can re-use the same configuration (and
typically do). Thus, sets ref-count the configuration. In other words,
when instantiating a new terminal, we may not have to instantiate a
new set of key bindings, but can often be incref:ed instead.

Whenever the keymap changes on a seat, all key bindings sets
associated with that seat reloads (re-resolves) their key bindings.

Closes #931
</content>
</entry>
<entry>
<title>render: implement ‘flash’ and search mode’s ‘dimming’ with a sub-surface</title>
<updated>2022-04-16T16:31:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T15:49:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=78fcdc578755af0c3a52a46521dbb4d9804ab790'/>
<id>urn:sha1:78fcdc578755af0c3a52a46521dbb4d9804ab790</id>
<content type='text'>
Search mode and ‘flash’ (OSC-555) both achieves similar visual
effects: flash tints the entire window yellow, and search mode dims
it (except the search match).

But, they do so in completely different ways. Search mode is detected
in render_cell(), and the colors are then dimmed there.

Flash is implemented by blending a yellow, semi-transparent color on
top of the rendered grid.

This patch replaces those two implementations with a single one. We
add a new sub-surface, called the ‘overlay’. In normal mode, it’s
unmapped.

When either search mode, or flash, is enabled, we enable it, and
fill it with a semi-transparent color. Yellow for ‘flash’, and
“black” (i.e. no color) for search mode.

The compositor then blends it with the grid. Hopefully on the GPU,
meaning it’ll be faster than if we blend in software.

There are more performance benefits however. By using a separate
surface, we can do much better damage tracking.

The normal grid rendering code no longer have to care about neither
search mode, nor flash. Thus, we get rid of a couple of ‘if’
statements in render_cell(), which is nice. But more importantly, we
can drop full grid repaints in a couple of circumstances:

* Entering/exiting search mode
* Every frame while flash is active

Now, when rendering the search mode overlay, we do want to do some
damage tracking, also of the overlay.

This, since search mode doesn’t dim the *entire* window. The search
match is *not* dimmed. This is implemented by punching a hole in the
overlay sub-surface. That is, we make part of it *fully*
transparent. The basic idea is to set a clip region that excludes the
search match, and then dim the rest of the overlay.

It’s slightly more complicated than that however, if we want to reuse
the last frame’s overlay buffer (i.e we don’t want to re-render
the *entire* overlay every frame).

In short, we need to:

* Clear (punch hole) in areas that are part of this frame’s search
  match, but not the last frame’s (since those parts are _already_
  cleared).
* Dim the areas that were part of the last frame’s search match, but
  aren’t anymore (the rest of the overlay should already be dimmed).

To do this, we save the last frame’s “holes” (as a pixman
region). Then, when rendering the next frame, we first calculate the
new frame’s “holes” region.

The region to clear is “this frame’s holes minus last frame’s holes”
The region to dim is “last frame’s holes minus this frames holes”.

Finally, we compute the bounding box of all modified cells by taking
the union of the two diff regions mentioned above. This allows us to
limit the buffer damage sent to the compositor.
</content>
</entry>
<entry>
<title>wayland: optionally disable pointer input on subsurfaces</title>
<updated>2022-04-16T15:41:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T15:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=129deaffa82650a1383f5816aa46f4a78a73b2ed'/>
<id>urn:sha1:129deaffa82650a1383f5816aa46f4a78a73b2ed</id>
<content type='text'>
We have a number of sub-surfaces for which we are *not* interrested in
pointer (or touch) input.

Up until now, we’ve manually dealt with these, by recognizing these
surfaces in all pointer events, and ignoring them.

But, lo and behold, there are better ways of doing this. By clearing
the subsurface’s input region, the compositor will do this for us -
when a pointer is outside a surface’s input region, the event is
passed to the next surface underneath it.

This is exactly what we want! Do this for all subsurfaces, *except*
the CSDs.
</content>
</entry>
<entry>
<title>config: add [csd].hide-when-maximized=yes|no</title>
<updated>2022-04-16T09:45:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-15T18:12:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fbcebd4f1c32f30bfedbad6a108acf6900ea955f'/>
<id>urn:sha1:fbcebd4f1c32f30bfedbad6a108acf6900ea955f</id>
<content type='text'>
When enabled, the CSD titlebar will be hidden when the window is
maximized.

Closes #1019
</content>
</entry>
<entry>
<title>wayland: add helper functions wayl_win_csd_{titlebar,borders}_visible()</title>
<updated>2022-04-16T09:42:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T09:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f9103d4381cab9d6c10024ab8fbcdb35b14ef239'/>
<id>urn:sha1:f9103d4381cab9d6c10024ab8fbcdb35b14ef239</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: take (visible) border width into account on configure events</title>
<updated>2022-04-16T09:17:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T09:15:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a0e7c6c012b6d3697389bf294f2321430e3b63d'/>
<id>urn:sha1:7a0e7c6c012b6d3697389bf294f2321430e3b63d</id>
<content type='text'>
When the compositor is asking us to resize ourselves, take
our (visible) CSD borders into account. This is similar to how we
already take the titlebar size into account.

This fixes an issue where the window size “jumps” when the user starts
an interactive resize, when csd.border-width &gt; 0.

This as been observed in GNOME.
</content>
</entry>
<entry>
<title>wayland: add wayl_bindings_reset()</title>
<updated>2022-02-09T16:51:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-07T18:52:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=026785b777fa2f9cb50a23db4c26e39a154ce4c3'/>
<id>urn:sha1:026785b777fa2f9cb50a23db4c26e39a154ce4c3</id>
<content type='text'>
This function resets (clears) all key- and mouse-bindings associated
with the seat.
</content>
</entry>
<entry>
<title>wayland: use key_bindings_destroy() to destroy the mouse bindings</title>
<updated>2022-02-09T16:51:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-07T18:44:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e1a4b5c5a80a820e3e5514ddab031eb98b14a02c'/>
<id>urn:sha1:e1a4b5c5a80a820e3e5514ddab031eb98b14a02c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: unify key- and mouse-binding structs</title>
<updated>2022-02-09T16:51:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-07T18:41:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dcd79065c87c69496ad4e2fa916053d8843a6c71'/>
<id>urn:sha1:dcd79065c87c69496ad4e2fa916053d8843a6c71</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: remove workaround for sway-1.5 bug - slow resizing of hidden windows</title>
<updated>2022-02-03T17:01:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-11T20:09:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=af4ae653493ecfbc570f1a16adc65a8c728dad0c'/>
<id>urn:sha1:af4ae653493ecfbc570f1a16adc65a8c728dad0c</id>
<content type='text'>
In Sway-1.5, sway waits for configure ACKs from hidden windows when
views are being resized. I.e. if you have e.g. a stacked view, with
one or more windows currently not visible, and you resize the stack,
then sway will emit configure events to all windows, and then wait for
ACKs before rendering the resized view.

The problem with this is that sway also does **not** call frame
callbacks on hidden windows. So if we have rendered one frame, and
thus registered a frame callback, we’ll never render any more frames
until the window becomes visible again. Ergo, if you resize the view
interactively, only the first resize actually happens. After that, all
hidden views are “stuck”, causing ACK timeouts.

We worked around this in foot by preempting the frame
callback. I.e. destroying it, and rendering the frame anyway.

This has fixed in sway-1.6, and thus we can remove the workaround.
</content>
</entry>
<entry>
<title>wayland: use strtol() to parse xcursor_size</title>
<updated>2022-01-29T12:22:06Z</updated>
<author>
<name>Pranjal Kole</name>
<email>pranjal.kole7@gmail.com</email>
</author>
<published>2022-01-29T12:01:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d9cd1749e0027dcb0f8e6bb755f69b99a1318e85'/>
<id>urn:sha1:d9cd1749e0027dcb0f8e6bb755f69b99a1318e85</id>
<content type='text'>
sscanf is not very robust. For example,
$ XCURSOR_SIZE="36asdf" foot
works without any errors, and xcursor_size is parsed as 36.
</content>
</entry>
<entry>
<title>wayland: use getenv() according to spec</title>
<updated>2022-01-29T10:48:19Z</updated>
<author>
<name>Pranjal Kole</name>
<email>pranjal.kole7@gmail.com</email>
</author>
<published>2022-01-29T10:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fa396cdc33c81cae52942154d69db39ee7079748'/>
<id>urn:sha1:fa396cdc33c81cae52942154d69db39ee7079748</id>
<content type='text'>
From the NOTES section of getenv(3):
 The string pointed to by the return value of getenv() may be statically
 allocated, and can be modified by a subsequent call to getenv()...

So, previously xcursor_theme could be modified by libc to contain
xcursor_size. This has been fixed by getting xcursor_theme after
computing the value of xcursor_size.
</content>
</entry>
<entry>
<title>config: convert tweak.render_timer to an enum</title>
<updated>2022-01-13T11:08:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-13T11:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=891fce62364704b7fc05bfe723a3619297b5b9e0'/>
<id>urn:sha1:891fce62364704b7fc05bfe723a3619297b5b9e0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: don’t try to bind wl_output version 4 unconditionally</title>
<updated>2022-01-06T19:00:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-06T19:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccf9c0fe29a8031804aa0d07a97da58c0e2cac04'/>
<id>urn:sha1:ccf9c0fe29a8031804aa0d07a97da58c0e2cac04</id>
<content type='text'>
The compositor may offer version 4, while we’re still linked against
an old libwayland that does not implement version 4.

While we properly #ifdef the callbacks from version 4, we were still
requesting version 4 (if offered by the compositor), even when
compiled against a too old libwayland.

Closes #876
</content>
</entry>
</feed>
