<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.h, branch 1.1.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.1.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.1.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-01-04T21:58:32Z</updated>
<entry>
<title>render: throttle xcursor updates</title>
<updated>2020-01-04T21:58:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T21:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ec447697c7548fc7930031077e821fd1e26b2f9'/>
<id>urn:sha1:5ec447697c7548fc7930031077e821fd1e26b2f9</id>
<content type='text'>
With a bad behaving client (e.g. 'less' with mouse support enabled),
we can end up with a *lot* of xcursor updates (so much, that we
flooded the wayland socket before we implemented a blocking
wayl_flush()).

Since there's little point in updating the cursor more than once per
frame interval, use frame callbacks to throttle the updates.

This works more or lesslike normal terminal refreshes:

render_xcursor_set() stores the last terminal (window) that had (and
updated) the cursor.

The renderer's FDM hook checks if we have such a pending terminal set,
and if so, tries to refresh the cursor.

This is done by first checking if we're already waiting for a callback
from a previous cursor update, and if so we do nothing; the callback
will update the cursor for the next frame. If we're *not* already
waiting for a callback, we update the cursor immediately.
</content>
</entry>
<entry>
<title>wayland: wl_display_flush() never blocks</title>
<updated>2020-01-04T20:10:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T20:10:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=abc36d8f090dbae1b127f74a83b601d3fa3c8bed'/>
<id>urn:sha1:abc36d8f090dbae1b127f74a83b601d3fa3c8bed</id>
<content type='text'>
Since it doesn't block, we need to detect EAGAIN failures and ensure
we actually flush everything.

If we don't, we sooner or later end up in a wayland client library
call that aborts due to the socket buffer being full.

Ideally, we'd simply enable POLLOUT in the FDM. However, we cannot
write *anything* to the wayland socket until we've actually managed to
send everything. This means enabling POLLOUT in the FDM wont work
since we may (*will*) end up trying to write more data to it before
we've flushed it.

So, add a wrapper function, wayl_flush(), that acts as a blocking
variant of wl_display_flush(), by detecting EAGAIN failiures and
calling poll() itself, on the wayland socket only, until all data has
been sent.
</content>
</entry>
<entry>
<title>wayland: don't use wl_display_dispatch()</title>
<updated>2020-01-03T20:02:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T20:02:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0ea0323d0fb3130e5bc1782812e70993e5cdb742'/>
<id>urn:sha1:0ea0323d0fb3130e5bc1782812e70993e5cdb742</id>
<content type='text'>
wl_display_dispatch() calls poll(), which is unnecessary since we
already know the FD is readable.

Use the more lower level wl_display_read_events() +
wl_display_dispatch_pending().

These require wl_display_prepare_read() to have been called.

The idea is to call wl_display_prepare_read() **before** calling
poll().

Thus, we do this more or less last in wayl_init(), and at the **end**
of the FDM handler.

However, having taking this lock also means we no longer can call
wl_display_roundtrip() directly (it will hang).

So, add a wrapper, wayl_roundtrip(), that cancels the read intent,
does the roundtrip, and then re-acquires the read intent.
</content>
</entry>
<entry>
<title>render: refresh: ensure window has been configured</title>
<updated>2020-01-03T17:55:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T17:55:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f7362d381b436718cc26565a09a3a38bf556586d'/>
<id>urn:sha1:f7362d381b436718cc26565a09a3a38bf556586d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: window: apply all configure changes after acking the event</title>
<updated>2020-01-03T12:54:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T12:54:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=46c434d3f10f0312211c2dc1360aed3e2ad0001b'/>
<id>urn:sha1:46c434d3f10f0312211c2dc1360aed3e2ad0001b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: remove wayl_terminal_from_xdg_{surface,toplevel}</title>
<updated>2020-01-03T12:46:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T12:46:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=765fe13aff4b9e9b3b1f487a6595a421efbd26b3'/>
<id>urn:sha1:765fe13aff4b9e9b3b1f487a6595a421efbd26b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: window now keeps pointer to owning terminal, not wayland</title>
<updated>2020-01-03T12:37:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-03T12:37:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9a0238bb524668c3ea24465943cd231167ae1428'/>
<id>urn:sha1:9a0238bb524668c3ea24465943cd231167ae1428</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: rename focused/moused to kbd_focus/mouse_focus</title>
<updated>2020-01-02T14:58:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-02T14:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4ecb0ecf4d1f45df918a8dd2dbabd6e9d7090dcc'/>
<id>urn:sha1:4ecb0ecf4d1f45df918a8dd2dbabd6e9d7090dcc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: only bind to 'presentation' interface if -p,--presentation-timings</title>
<updated>2019-12-31T15:12:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-31T15:12:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b100a82c2a1aa75bb8a27e2d2a1235b36359a161'/>
<id>urn:sha1:b100a82c2a1aa75bb8a27e2d2a1235b36359a161</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: optionally use the presentation time protocol to measure input lag</title>
<updated>2019-12-31T14:39:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-31T14:39:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a074190960130b6136a398d83da43fd1e8ec7e2'/>
<id>urn:sha1:5a074190960130b6136a398d83da43fd1e8ec7e2</id>
<content type='text'>
This adds a flag, -p,--presentation-timings, that enables input lag
measuring using the presentation time Wayland protocol.

When enabled, we store a timestamp when we *send* a key to the
slave. Then, when we commit a frame for rendering to the compositor,
we request presentation feedback. We also store a timestamp for when
the frame was committed.

The 'presented' callback then looks at the input and commit
timestamps, and compares it with the presented timestamp.

The delay is logged at INFO when the delay was less than one frame
interval, at WARN when it was one frame interval, and at ERR when it
was two or more frame intervals.

We also update statistic counters that we log when foot is shut down.
</content>
</entry>
<entry>
<title>wayland: include more output (monitor) details in the log output</title>
<updated>2019-12-05T18:35:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-05T18:35:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=db1d913ba8ce586b6597b093f192ae1af8b844dd'/>
<id>urn:sha1:db1d913ba8ce586b6597b093f192ae1af8b844dd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fcft: use fcft instead of local copy of font.c/font.h</title>
<updated>2019-12-01T12:43:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-01T12:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fd9c28464db8e3f334819ec9d773bf31ed37c088'/>
<id>urn:sha1:fd9c28464db8e3f334819ec9d773bf31ed37c088</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: track current xcursor, and don't update if same</title>
<updated>2019-11-30T11:09:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-30T11:09:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a87b39f6eb18b5b3674afcb3f24816d933eab319'/>
<id>urn:sha1:a87b39f6eb18b5b3674afcb3f24816d933eab319</id>
<content type='text'>
We may have many windows open, which tries to update/change the
xcursor at various points.

Track which cursor is currently loaded, regardless of which window it
was set by. If someone tries to load that very same xcursor again,
simply skip it.

One example is when we've moused over a window that does *not* have
keyboard focus, and then the user clicks, or by some other mean gives
that window keyboard focus. In many cases it will then try to set the
same cursor again (most of the times, the cursor is the same
regardless of keyboard focus, but not always).
</content>
</entry>
<entry>
<title>terminal: use the 'text' xcursor pointer whenever selection is possible</title>
<updated>2019-11-28T18:35:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-28T18:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0dd37f0a364fc36284dad17e8fb1345714261a4a'/>
<id>urn:sha1:0dd37f0a364fc36284dad17e8fb1345714261a4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: calculate output PPI (pixels-per-inch)</title>
<updated>2019-11-26T18:02:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-26T17:55:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=204bfa02f453dc931b0491f0f6f8313ad9183944'/>
<id>urn:sha1:204bfa02f453dc931b0491f0f6f8313ad9183944</id>
<content type='text'>
</content>
</entry>
<entry>
<title>terminal: call user-defined callback when destroying terminal</title>
<updated>2019-11-01T19:34:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-01T19:34:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1e41a25f00aab1038486cff37e286fd5c729a72b'/>
<id>urn:sha1:1e41a25f00aab1038486cff37e286fd5c729a72b</id>
<content type='text'>
main uses this to get the exit code of the terminal.
</content>
</entry>
<entry>
<title>wayland: wayl_win_destroy(): unmap windows before destroying</title>
<updated>2019-11-01T19:19:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-01T19:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=95b7c405d464b0eb04141cbbfe077371f5a9d47c'/>
<id>urn:sha1:95b7c405d464b0eb04141cbbfe077371f5a9d47c</id>
<content type='text'>
This will trigger e.d. keyboard_leave() and wl_pointer_leave() events,
which ensures there aren't any references to the destroyed window from
the global wayland struct.

Call wl_display_roundtrip() to trigger those events *before* we
destroy the window.
</content>
</entry>
<entry>
<title>wayland: temporary: track last terminal's exit value</title>
<updated>2019-10-30T19:25:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-30T19:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ed78ab44303b5123a8c6acb6b624da84d0268f0'/>
<id>urn:sha1:1ed78ab44303b5123a8c6acb6b624da84d0268f0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: track multiple terminals</title>
<updated>2019-10-30T19:02:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-30T19:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=445bbe3469b057c8b518f7c787527128f724cc1b'/>
<id>urn:sha1:445bbe3469b057c8b518f7c787527128f724cc1b</id>
<content type='text'>
The wayland 'term' member is gone and replaced by a list,
'terms'. This list contains all currently running terminal (windows).
</content>
</entry>
<entry>
<title>wayland: move reload_cursor_theme() and update_cursor_surface() to wayland</title>
<updated>2019-10-27T18:36:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-27T18:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=957fb255594d634fdd1c2458546babd2b08114a0'/>
<id>urn:sha1:957fb255594d634fdd1c2458546babd2b08114a0</id>
<content type='text'>
</content>
</entry>
</feed>
