<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch 1.15.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.15.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.15.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-07-18T14:09:31Z</updated>
<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>
<entry>
<title>cursor-shape: add support for server side cursor shapes</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T15:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c8e13ad3938d68635693d0b0f4bf1054628e8387'/>
<id>urn:sha1:c8e13ad3938d68635693d0b0f4bf1054628e8387</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>wayland: handle enum value XDG_TOPLEVEL_STATE_SUSPENDED</title>
<updated>2023-07-03T12:36:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-03T12:36:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=72bc0acfbd4b002ebf26d65368bb65601452353e'/>
<id>urn:sha1:72bc0acfbd4b002ebf26d65368bb65601452353e</id>
<content type='text'>
Added in wayland-protocols-1.32
</content>
</entry>
<entry>
<title>wayland: typo: ‘.’ -&gt; ‘;’</title>
<updated>2023-06-30T06:24:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-30T06:24:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5e305fa8547bbdeef765813ca4a1c29037248ee9'/>
<id>urn:sha1:5e305fa8547bbdeef765813ca4a1c29037248ee9</id>
<content type='text'>
Closes #1392
</content>
</entry>
<entry>
<title>wayland: surface_scale(): reset buffer scale when using fractional scaling</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T19:09:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ce31cc518a48d978c84448424d0d2a6bba4a5a5f'/>
<id>urn:sha1:ce31cc518a48d978c84448424d0d2a6bba4a5a5f</id>
<content type='text'>
Since the first frame uses legacy scaling, the surface may have a
buffer scale &gt; 1, which isn’t allowed.
</content>
</entry>
<entry>
<title>wayland: surface_scale(): improve debug logging</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T19:09:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c61247f317b8b0559feeda551e8e7e33b54d3b3e'/>
<id>urn:sha1:c61247f317b8b0559feeda551e8e7e33b54d3b3e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: use legacy scaling until fractional_scale::preferred_scale() has been called</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T19:07:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f74b1090a6a5297ac7b6710420528ff56ed03d2'/>
<id>urn:sha1:8f74b1090a6a5297ac7b6710420528ff56ed03d2</id>
<content type='text'>
This way, the initial frame is more likely to get scaled correctly;
foot will guess the initial (integer) scale from the available
monitors, and use that. By using legacy scaling, we force the
compositor to down-scale the image to the correct scale factor.

If we use the new fraction scaling method with an integer scaling
factor, the initial frame gets rendered way too big.
</content>
</entry>
<entry>
<title>wayland: refactor: surface_scale(): pass wl_window pointer, instead of wayland global</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T19:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d71e588800fea0f7b7815cc5ce51ded752070b95'/>
<id>urn:sha1:d71e588800fea0f7b7815cc5ce51ded752070b95</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: surface_scale(): assert surface width/height is a multiple of scale</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T18:25:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c309c9f572a331881c515d7715d474ef854ea958'/>
<id>urn:sha1:c309c9f572a331881c515d7715d474ef854ea958</id>
<content type='text'>
When doing legacy scaling (non-fractional scaling), assert the
surface’s width and height are multiples of the (integer) scale.
</content>
</entry>
<entry>
<title>wayland: warn when fractional scaling isn’t available</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T16:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8a4efb34276e9f15a65304477c40e71aa281f7ae'/>
<id>urn:sha1:8a4efb34276e9f15a65304477c40e71aa281f7ae</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: dpi-aware: remove ‘auto’ value, and default to ‘no’</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T15:55:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=64b6b5d2a7b81bcad3f0a50a6c1556fd7300c171'/>
<id>urn:sha1:64b6b5d2a7b81bcad3f0a50a6c1556fd7300c171</id>
<content type='text'>
We now default to scaling fonts using the scaling factor, not monitor
DPI.

The ‘auto’ value for dpi-aware has been removed.

Documentation (man pages and README) have been updated to reflect the
new default.
</content>
</entry>
<entry>
<title>wayland: update terminal when preferred scaling factor changes</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T15:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0bdb6580bd5f470ca82e771c70a8f7cd4f5a0240'/>
<id>urn:sha1:0bdb6580bd5f470ca82e771c70a8f7cd4f5a0240</id>
<content type='text'>
When the window’s preferred scaling factor is changed (through the
fractional-scaling protocol), update the terminal; resize font, resize
sub-surfaces etc.
</content>
</entry>
<entry>
<title>wayland: surface_scale(): implement fractional scaling</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T15:32:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8ccabb79745f079417b3a049f52c4779d6efdf07'/>
<id>urn:sha1:8ccabb79745f079417b3a049f52c4779d6efdf07</id>
<content type='text'>
This is done by setting the surface’s viewport destination
</content>
</entry>
</feed>
