<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch 1.16.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.16.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.16.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-10-02T14:34:54Z</updated>
<entry>
<title>wayland: debug: log wm-capabilities as human-readable strings</title>
<updated>2023-10-02T14:34:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-02T14:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=883368572ff3c21653c77fea34fc8ec8a0599b56'/>
<id>urn:sha1:883368572ff3c21653c77fea34fc8ec8a0599b56</id>
<content type='text'>
</content>
</entry>
<entry>
<title>changelog: crash when xdg token is set, but compositor does not support activation</title>
<updated>2023-09-21T16:31:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-09-21T16:31:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b2963bbf80973bd23e1d4ff4ead0df917dce7c6b'/>
<id>urn:sha1:b2963bbf80973bd23e1d4ff4ead0df917dce7c6b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: check activation supported before activating</title>
<updated>2023-09-21T06:59:48Z</updated>
<author>
<name>Alyssa Ross</name>
<email>hi@alyssa.is</email>
</author>
<published>2023-09-21T06:59:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9257273d84de2ef75ab505c9f954e0af6a2af78d'/>
<id>urn:sha1:9257273d84de2ef75ab505c9f954e0af6a2af78d</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>input: improve touch handling on pointer presense</title>
<updated>2023-08-23T16:45:20Z</updated>
<author>
<name>CismonX</name>
<email>admin@cismon.net</email>
</author>
<published>2023-08-19T15:01:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f0f0d02bf74b1ba4279b25883db7b48619242377'/>
<id>urn:sha1:f0f0d02bf74b1ba4279b25883db7b48619242377</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>wayland: cursor-shape-v1 is now always available</title>
<updated>2023-08-07T14:53:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-31T14:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=698c5b54f32c885304d5e2ff55580ce7f52b5da7'/>
<id>urn:sha1:698c5b54f32c885304d5e2ff55580ce7f52b5da7</id>
<content type='text'>
Since we're requiring wayland-protocols &gt;= 1.32
</content>
</entry>
<entry>
<title>wayland: fractional-scale-v1 is now always available</title>
<updated>2023-08-07T14:53:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-31T14:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7eee415b7573f5a20852c6e29001945149e920a2'/>
<id>urn:sha1:7eee415b7573f5a20852c6e29001945149e920a2</id>
<content type='text'>
Since we're requiring wayland-protocols &gt;= 1.32
</content>
</entry>
<entry>
<title>wayland: xdg-activation is now always available</title>
<updated>2023-08-07T14:53:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-31T14:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d59a4e7a779dd8bd5cea1e0ec18ce2c326dffbd1'/>
<id>urn:sha1:d59a4e7a779dd8bd5cea1e0ec18ce2c326dffbd1</id>
<content type='text'>
Since we're requiring wayland-protocols &gt;= 1.32
</content>
</entry>
<entry>
<title>wayl_surface_scale_explicit_width_height(): don’t assert width/height are valid for scale</title>
<updated>2023-07-29T06:18:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-29T06:18:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=764248bb0d846f65c20931024c1f4adca57aae29'/>
<id>urn:sha1:764248bb0d846f65c20931024c1f4adca57aae29</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>fractional scaling: another round(!) of rounding fixes</title>
<updated>2023-07-28T14:03:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-28T13:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=17824744812c16560dd214b98f28977b0d2fb47d'/>
<id>urn:sha1:17824744812c16560dd214b98f28977b0d2fb47d</id>
<content type='text'>
* 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.
</content>
</entry>
<entry>
<title>wayland: don't try to use a non-existing viewporter interface</title>
<updated>2023-07-28T13:42:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-28T13:32:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9d75c551465fa3dbb3cd20ae87d6de294fcebce1'/>
<id>urn:sha1:9d75c551465fa3dbb3cd20ae87d6de294fcebce1</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>scaling: always round the scaling factor when converting to int</title>
<updated>2023-07-25T14:48:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-25T13:56:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=613c61abb44e49236a893376764eb21702c0ef32'/>
<id>urn:sha1:613c61abb44e49236a893376764eb21702c0ef32</id>
<content type='text'>
* In all calls to wl_subsurface_set_position()
* (wp_viewport_set_destination() already does this)
* Whenever we use the scale to calculate margins (search box,
  scrollback indicator etc)
* Since the scaling factor is stored as a float (and not a double),
  use roundf() instead of round()
</content>
</entry>
<entry>
<title>wayland: update terminals (fonts etc) on xdg_output_handle_done()</title>
<updated>2023-07-23T18:12:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-23T18:03:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0a61cfc3beb881fc8942ae99bf3ad3b5de5e6345'/>
<id>urn:sha1:0a61cfc3beb881fc8942ae99bf3ad3b5de5e6345</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>wayland: fix pointer cap lost handling</title>
<updated>2023-07-18T14:09:31Z</updated>
<author>
<name>xdavidwu</name>
<email>xdavidwuph@gmail.com</email>
</author>
<published>2023-07-18T13:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0b8791d1c5d1bc71daff481874e6c9e44d0dba79'/>
<id>urn:sha1:0b8791d1c5d1bc71daff481874e6c9e44d0dba79</id>
<content type='text'>
Before this, on compositor without cursor-shape support, a pointer
capability lost of the seat makes foot crash.
</content>
</entry>
<entry>
<title>terminal: break out scaling factor updating, and reduce number of calls to render_resize()</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=21d99f8dced335826964ca96b8ba7ccac059e598'/>
<id>urn:sha1:21d99f8dced335826964ca96b8ba7ccac059e598</id>
<content type='text'>
Break out the logic that updates the terminal’s scaling factor value,
from render_resize(), to a new function, term_update_scale(). This
allows us to update the scaling factor without a full grid resize.

We also change how we pick the scaling factor (when fractional scaling
is not in use). Before, we’d use the highest scaling factor from all
monitors we were mapped on. Now, we use the scaling factor from the
monitor we were *last* mapped on.

Then, add a boolean parameter to term_set_fonts(), and when
false, *don’t* call render_resize_force().

Also change term_font_dpi_changed() to only return true if the font
was changed in any way.

Finally, rewrite update_term_for_output_change() to:

* Call term_update_scale() before doing anything else
* Call render_resize{,_force} *last*, and *only* if either the scale
  or the fonts were updated.

This fixes several things:

* A bug where we failed to update the fonts when fractional scaling
  was in use, and we guessed the initial scale/DPI wrong. The bug
  happened because updated the internal "preferred" scale value, and a
  later call to render_resize() updated the terminal’s scale value,
  but since that code path didn’t call term_font_dpi_changed() (and it
  shouldn’t), the fonts weren’t resized properly.

* It ensures we only resize the grid *once* when the scaling factor,
  or DPI is changed. Before this, we’d resize it twice. And this
  happened when e.g. dragging the window between monitors.
</content>
</entry>
<entry>
<title>wayland: error out if there aren’t any monitors available</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:19:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c96863b1882088271dd9867c4fd258a9a5fa6a79'/>
<id>urn:sha1:c96863b1882088271dd9867c4fd258a9a5fa6a79</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: use physical DPI on fractional-scale capable compositors</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b2a29280cbd3fcd825123e7636d511a06b2df242'/>
<id>urn:sha1:b2a29280cbd3fcd825123e7636d511a06b2df242</id>
<content type='text'>
With legacy scaling, we need to use a "scaled", or "logical" DPI
value, that is basically the real DPI value scaled by the monitor’s
scaling factor.

This is necessary to compensate for the compositor downscaling the
surface, for "fake" fractional scaling.

But with true fractional scaling, *we* scale the surface to the final
size. This means we should *not* use the scaled DPI, but the monitor’s
actual DPI.

To facilitate this, store both the scaled and the unscaled DPI value
in the monitor struct.

This patch also changes how we pick the DPI value. Before, we would
use the highest DPI value from all the monitors we were mapped
on. Now, we use the DPI value from the monitor we were *last* mapped
on (typically the window we’re dragging the window *to*).
</content>
</entry>
<entry>
<title>wayland: fractional_scale_preferred_scale(): only push update if scale has changed</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:12:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=59f0a721c4663aafd30179e34a38165dd137a0db'/>
<id>urn:sha1:59f0a721c4663aafd30179e34a38165dd137a0db</id>
<content type='text'>
Also, drop wl_window::have_preferred_scale. Check for scale &gt; 0 instead.
</content>
</entry>
<entry>
<title>render: use rounding for fractional scale</title>
<updated>2023-07-16T03:03:16Z</updated>
<author>
<name>Ronan Pigott</name>
<email>ronan@rjp.ie</email>
</author>
<published>2023-07-14T23:53:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b7100d57160d2ae7a38d5517f1c2cd7155737d88'/>
<id>urn:sha1:b7100d57160d2ae7a38d5517f1c2cd7155737d88</id>
<content type='text'>
If we truncate the buffer dimensions we may accidentally submit a
buffer with inappropriate size.
</content>
</entry>
<entry>
<title>input: add basic support for touchscreen input</title>
<updated>2023-07-05T14:22:28Z</updated>
<author>
<name>CismonX</name>
<email>admin@cismon.net</email>
</author>
<published>2023-07-04T16:19:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d2fcb5343f57c132abec9a21ad89d1505a32c47c'/>
<id>urn:sha1:d2fcb5343f57c132abec9a21ad89d1505a32c47c</id>
<content type='text'>
Closes #517
</content>
</entry>
<entry>
<title>cursor-shape: use server-side cursors for custom (OSC-22), if possible</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-28T11:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c2baaff3c1311335b46e75db27bfd79d4f7b623b'/>
<id>urn:sha1:c2baaff3c1311335b46e75db27bfd79d4f7b623b</id>
<content type='text'>
Using a lookup table, try to map the user-provided xcursor string to a
cursor-shape-v1 known shape.

If we succeed, set the user’s custom cursor using server side
cursors (i.e. using cursor-shape-v1).

If not, fallback to trying to load the image ourselves (using
wl_cursor_theme_get_cursor()), and set it using the legacy
wl_pointer_set_cursor().
</content>
</entry>
</feed>
