<feed xmlns='http://www.w3.org/2005/Atom'>
<title>swaylock/.git/render.c, branch v1.8.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/'/>
<entry>
<title>Check if keymap is NULL before dereferencing</title>
<updated>2025-01-29T10:04:00+00:00</updated>
<author>
<name>Mikkel Stårvik</name>
<email>mikkel.starvik@gmail.com</email>
</author>
<published>2025-01-28T08:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=a439abb8c991de1c5bbc8d5c105b56599abb9e06'/>
<id>a439abb8c991de1c5bbc8d5c105b56599abb9e06</id>
<content type='text'>
This avoids segfaulting when a frame is rendered before a keymap has been received, which happens consistently on some systems when swaylock is started after starting the suspend process
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This avoids segfaulting when a frame is rendered before a keymap has been received, which happens consistently on some systems when swaylock is started after starting the suspend process
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve frame callback and commit handling</title>
<updated>2024-09-06T23:46:24+00:00</updated>
<author>
<name>Kenny Levinsen</name>
<email>kl@kl.wtf</email>
</author>
<published>2024-09-06T22:27:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=cca2436ba535d17c49b7d7ba75ebfa6a18ec9209'/>
<id>cca2436ba535d17c49b7d7ba75ebfa6a18ec9209</id>
<content type='text'>
The few places that required a surface commit relied on render_frame and
render_frame_background to form it form them after they had set up frame
callback events. This would fail if render_frame ran out of buffers and
exited early, as the caller would still wait indefinitely on the frame
callback.

swaylock would quite consistently run out of buffers when rendering
immediately after a configure event, such as when the keypress causing
render also caused outputs to be enabled from idle.

Restructure the render and commit handling slightly so that the whole
frame callback and commit setup is handled by the render code, which now
has a single render entrypoint. This both avoids stalls from lacking
commits, but also fixes the case the configure path to respect frame
callbacks so we do not run out of buffers in the first place.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The few places that required a surface commit relied on render_frame and
render_frame_background to form it form them after they had set up frame
callback events. This would fail if render_frame ran out of buffers and
exited early, as the caller would still wait indefinitely on the frame
callback.

swaylock would quite consistently run out of buffers when rendering
immediately after a configure event, such as when the keypress causing
render also caused outputs to be enabled from idle.

Restructure the render and commit handling slightly so that the whole
frame callback and commit setup is handled by the render code, which now
has a single render entrypoint. This both avoids stalls from lacking
commits, but also fixes the case the configure path to respect frame
callbacks so we do not run out of buffers in the first place.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't drop the buffer until after surface commit</title>
<updated>2023-06-12T12:17:43+00:00</updated>
<author>
<name>Sophie Winter</name>
<email>git@phie.me</email>
</author>
<published>2023-06-09T03:32:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=2018673e1df020fba73870a9f65314d195d72769'/>
<id>2018673e1df020fba73870a9f65314d195d72769</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Separate input and auth state</title>
<updated>2023-05-09T10:40:41+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2023-05-03T01:00:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=31ebd85fe09701146b7275de1ec8c8e9ce3c15c6'/>
<id>31ebd85fe09701146b7275de1ec8c8e9ce3c15c6</id>
<content type='text'>
This commit establishes separate state machines for auth state (whether
the password submitted is being verified or is wrong) and input state
(typing indicators and clear message -- things relevant to the state of
the password being typed in, before it is submitted.) This makes it
possible to display the auth state while updating the input state (for
example, show that the previously submitted password is 'verifying' or
'wrong' while typing another.)

The two state machines interact only when submitting a password. There
is some interference with the rendering code -- a 'cleared' message
from the input state machine supersedes verifying/wrong messages from
the auth state machine; although since the 'clear' state has a shorter
timeout than the auth 'invalid' state, this is unlikely to hide the 'wrong'
message.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit establishes separate state machines for auth state (whether
the password submitted is being verified or is wrong) and input state
(typing indicators and clear message -- things relevant to the state of
the password being typed in, before it is submitted.) This makes it
possible to display the auth state while updating the input state (for
example, show that the previously submitted password is 'verifying' or
'wrong' while typing another.)

The two state machines interact only when submitting a password. There
is some interference with the rendering code -- a 'cleared' message
from the input state machine supersedes verifying/wrong messages from
the auth state machine; although since the 'clear' state has a shorter
timeout than the auth 'invalid' state, this is unlikely to hide the 'wrong'
message.
</pre>
</div>
</content>
</entry>
<entry>
<title>Synchronize highlight position between outputs</title>
<updated>2023-04-02T00:34:19+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2023-03-28T23:42:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=75e837c31abe2fa06167b6f1f1a253ab397faf81'/>
<id>75e837c31abe2fa06167b6f1f1a253ab397faf81</id>
<content type='text'>
This change has the additional benefit of ensuring that the position
of the highlight only changes in reaction to a letter key or
backspace being pressed, and not when the compositor sends a new
configure event or the output needs to be redrawn for some other
reason.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change has the additional benefit of ensuring that the position
of the highlight only changes in reaction to a letter key or
backspace being pressed, and not when the compositor sends a new
configure event or the output needs to be redrawn for some other
reason.
</pre>
</div>
</content>
</entry>
<entry>
<title>Stop pooling background surface buffers</title>
<updated>2023-03-22T09:56:42+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2023-03-12T20:48:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=1d3e62c67f07a180fca02a6df1cf9648f2b50349'/>
<id>1d3e62c67f07a180fca02a6df1cf9648f2b50349</id>
<content type='text'>
The wl_buffers for the background surface only need to be updated
when the output dimensions change. Using the fixed pool of two
buffers to cache these buffers does not help, since if a new buffer
is needed, it will have a different size than whatever buffers were
cached. Furthermore, because the pool has fixed size, it is possible
to run out of buffers if configure events arrive faster than
pool buffers are marked not busy, which can lead to protocol errors
when the background surface is committed after acknowledging a new
size, but without attaching a buffer that matches that size.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The wl_buffers for the background surface only need to be updated
when the output dimensions change. Using the fixed pool of two
buffers to cache these buffers does not help, since if a new buffer
is needed, it will have a different size than whatever buffers were
cached. Furthermore, because the pool has fixed size, it is possible
to run out of buffers if configure events arrive faster than
pool buffers are marked not busy, which can lead to protocol errors
when the background surface is committed after acknowledging a new
size, but without attaching a buffer that matches that size.
</pre>
</div>
</content>
</entry>
<entry>
<title>Estimate buffer size in advance for render_frame</title>
<updated>2023-01-27T11:19:32+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2023-01-14T19:51:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=10ab8b274020a9323413d093c45f13490929fb81'/>
<id>10ab8b274020a9323413d093c45f13490929fb81</id>
<content type='text'>
The size of the surface used to draw the indicator depends on
the extents of the text being drawn on and under the indicator.

This commit refactors the `render_frame` function so that the surface
size is computed before drawing; before, `render_frame` drew onto a
buffer, estimated the size the buffer should have had, and recursively
called itself to try again with the estimated size, if necessary. This
was done because Cairo's methods to estimate font and text size
require that a cairo_t context object and an associated cairo_surface
already have been set up. Since the surface size depends on the text
size, the natural way to use Cairo would have a circular dependency.

In order to compute sizes _before_ the buffer is created, this commit
adds a 1x1 surface and a matching `test_cairo` context which is set to
the same font and drawing parameters as the buffer that will be
created. Font/text extent measurements should give the same results as
for the final buffer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The size of the surface used to draw the indicator depends on
the extents of the text being drawn on and under the indicator.

This commit refactors the `render_frame` function so that the surface
size is computed before drawing; before, `render_frame` drew onto a
buffer, estimated the size the buffer should have had, and recursively
called itself to try again with the estimated size, if necessary. This
was done because Cairo's methods to estimate font and text size
require that a cairo_t context object and an associated cairo_surface
already have been set up. Since the surface size depends on the text
size, the natural way to use Cairo would have a circular dependency.

In order to compute sizes _before_ the buffer is created, this commit
adds a 1x1 surface and a matching `test_cairo` context which is set to
the same font and drawing parameters as the buffer that will be
created. Font/text extent measurements should give the same results as
for the final buffer.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove overridden surface attachment</title>
<updated>2023-01-27T11:19:32+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2023-01-14T19:49:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=b4e3a2b0fdda3fcbc40e19c94bb7a7961aa7653c'/>
<id>b4e3a2b0fdda3fcbc40e19c94bb7a7961aa7653c</id>
<content type='text'>
The removed lines had no effect, since later in `render_frame`
buffer-&gt;buffer is attached to surface-&gt;child.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The removed lines had no effect, since later in `render_frame`
buffer-&gt;buffer is attached to surface-&gt;child.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix capitalization.</title>
<updated>2022-11-21T15:31:11+00:00</updated>
<author>
<name>sonny</name>
<email>106631960+digitalwtf@users.noreply.github.com</email>
</author>
<published>2022-11-06T01:31:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=226244e93ce513de07064b88ff746b8424571672'/>
<id>226244e93ce513de07064b88ff746b8424571672</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: work with current buffer locally</title>
<updated>2022-11-14T20:06:41+00:00</updated>
<author>
<name>Alexander Orzechowski</name>
<email>orzechowski.alexander@gmail.com</email>
</author>
<published>2022-09-24T08:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=5c1b16b957bfc45010dd22a03aa8f5135d3bac0c'/>
<id>5c1b16b957bfc45010dd22a03aa8f5135d3bac0c</id>
<content type='text'>
No need to store this globally accessible struct member.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No need to store this globally accessible struct member.
</pre>
</div>
</content>
</entry>
</feed>
