<feed xmlns='http://www.w3.org/2005/Atom'>
<title>swaylock/.git/main.c, branch master</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>main: don't abort when an image path expands to no words</title>
<updated>2026-10-29T08:38:09+00:00</updated>
<author>
<name>Martin Trojer</name>
<email>martin.trojer@gmail.com</email>
</author>
<published>2026-10-29T08:35:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=701a352e7eb03f5daf4252ea0a0f7aa437819b71'/>
<id>701a352e7eb03f5daf4252ea0a0f7aa437819b71</id>
<content type='text'>
An expansion can yield no words (e.g. -i '' or an unset variable),
which made join_args() assert and swaylock abort before locking.
Use an empty path in that case, so loading it fails normally and
swaylock carries on and locks, instead of falling back to the
unexpanded string. Also free path and output_name on the
failed-load return.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An expansion can yield no words (e.g. -i '' or an unset variable),
which made join_args() assert and swaylock abort before locking.
Use an empty path in that case, so loading it fails normally and
swaylock carries on and locks, instead of falling back to the
unexpanded string. Also free path and output_name on the
failed-load return.
</pre>
</div>
</content>
</entry>
<entry>
<title>main: destroy replaced image surface with cairo_surface_destroy</title>
<updated>2026-10-28T21:01:33+00:00</updated>
<author>
<name>Martin Trojer</name>
<email>martin.trojer@gmail.com</email>
</author>
<published>2026-10-28T07:23:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=711bbd9de97ff3df672690042000df9f753ab8bd'/>
<id>711bbd9de97ff3df672690042000df9f753ab8bd</id>
<content type='text'>
A later -i for the same output replaces the earlier image, but the old
cairo surface was released with free(), leaking its pixel buffer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A later -i for the same output replaces the earlier image, but the old
cairo surface was released with free(), leaking its pixel buffer.
</pre>
</div>
</content>
</entry>
<entry>
<title>main: fix reversed dup2 arguments in daemonize</title>
<updated>2026-07-09T09:58:43+00:00</updated>
<author>
<name>Sergey Zagursky</name>
<email>sz@joom.com</email>
</author>
<published>2026-07-09T08:23:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=83319e5ec7ae13794ebf39f753d643a2a439f594'/>
<id>83319e5ec7ae13794ebf39f753d643a2a439f594</id>
<content type='text'>
daemonize() intends to redirect the daemon's stdout and stderr to
/dev/null, but the dup2() arguments are reversed. dup2(oldfd, newfd)
duplicates oldfd onto newfd; the code passes STDOUT_FILENO/STDERR_FILENO
as oldfd and the freshly opened /dev/null descriptor as newfd, so it
overwrites the /dev/null fd with stdout/stderr and then closes it.
stdout and stderr are never redirected and stay attached to the
controlling terminal.

Swap the arguments so /dev/null is duplicated onto STDOUT_FILENO and
STDERR_FILENO as intended.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
daemonize() intends to redirect the daemon's stdout and stderr to
/dev/null, but the dup2() arguments are reversed. dup2(oldfd, newfd)
duplicates oldfd onto newfd; the code passes STDOUT_FILENO/STDERR_FILENO
as oldfd and the freshly opened /dev/null descriptor as newfd, so it
overwrites the /dev/null fd with stdout/stderr and then closes it.
stdout and stderr are never redirected and stay attached to the
controlling terminal.

Swap the arguments so /dev/null is duplicated onto STDOUT_FILENO and
STDERR_FILENO as intended.
</pre>
</div>
</content>
</entry>
<entry>
<title>check for pending callback on destroy_surface</title>
<updated>2025-08-16T14:22:15+00:00</updated>
<author>
<name>Armin Preiml</name>
<email>apreiml@strohwolke.at</email>
</author>
<published>2025-08-14T16:43:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=c8a74c0c2de9fb257b1273ff6fbbbf7eb4e6a6da'/>
<id>c8a74c0c2de9fb257b1273ff6fbbbf7eb4e6a6da</id>
<content type='text'>
Avoids segfaults when a pending surface_frame_handle_done is invoked
after destruction of the associated surface.

This happened when an output was removed and the surfaces have been
destroyed, between render and the surface_frame_handle_done.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoids segfaults when a pending surface_frame_handle_done is invoked
after destruction of the associated surface.

This happened when an output was removed and the surfaces have been
destroyed, between render and the surface_frame_handle_done.
</pre>
</div>
</content>
</entry>
<entry>
<title>main: change background color to #a3a3a3</title>
<updated>2025-07-16T17:51:06+00:00</updated>
<author>
<name>Panagiotis "Ivory" Vasilopoulos</name>
<email>git@n0toose.net</email>
</author>
<published>2025-07-15T12:45:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=ae26713c9ce780a97f3ee74afdb47a0c5b569ed4'/>
<id>ae26713c9ce780a97f3ee74afdb47a0c5b569ed4</id>
<content type='text'>
This is a port of the change I made to i3lock a couple of years ago,
see: https://github.com/i3/i3lock/pull/300/commits

FFFFFF can cause varying degrees of uncomfortableness to users like me,
especially during night time. Uncomfortableness can mean "migraines" or
being woken up if the electric wiring is suboptimal, causing a desktop
to wake up (the latter of which is why I opened the i3lock PR, despite
the effort associated with changing defaults).

However, the choice of a color that is not solid white helps users tell
whether their computer is turned off or not. Light gray (#a3a3a3) is
a compromise that is bright, but not "flashbang levels" of bright.

This compromise was met after a long discussion with the i3lock
developers, and, given the similarities between i3lock and swaylock,
this change could be sensible for swaylock as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a port of the change I made to i3lock a couple of years ago,
see: https://github.com/i3/i3lock/pull/300/commits

FFFFFF can cause varying degrees of uncomfortableness to users like me,
especially during night time. Uncomfortableness can mean "migraines" or
being woken up if the electric wiring is suboptimal, causing a desktop
to wake up (the latter of which is why I opened the i3lock PR, despite
the effort associated with changing defaults).

However, the choice of a color that is not solid white helps users tell
whether their computer is turned off or not. Light gray (#a3a3a3) is
a compromise that is bright, but not "flashbang levels" of bright.

This compromise was met after a long discussion with the i3lock
developers, and, given the similarities between i3lock and swaylock,
this change could be sensible for swaylock as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>main: null-terminate initial password buffer</title>
<updated>2025-03-21T04:43:42+00:00</updated>
<author>
<name>Keenan Gugeler</name>
<email>me@kgugeler.ca</email>
</author>
<published>2025-03-21T01:40:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=66b6c7e5802dfe76fbba5daa58b3d517e477bbd0'/>
<id>66b6c7e5802dfe76fbba5daa58b3d517e477bbd0</id>
<content type='text'>
Fixes #403.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #403.
</pre>
</div>
</content>
</entry>
<entry>
<title>Define _POSIX_C_SOURCE globally</title>
<updated>2025-03-18T21:31:01+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2025-03-18T21:23:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=0b10244dc09c7108e7046700a4cd0a64dde57380'/>
<id>0b10244dc09c7108e7046700a4cd0a64dde57380</id>
<content type='text'>
Other Sway projects have switched to this approach.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Other Sway projects have switched to this approach.
</pre>
</div>
</content>
</entry>
<entry>
<title>Better handle subprocess crashes</title>
<updated>2025-03-12T10:17:13+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2025-03-12T00:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=34e0aabc51074a2476d27148c4f755d558da3ec9'/>
<id>34e0aabc51074a2476d27148c4f755d558da3ec9</id>
<content type='text'>
On my machine EOF doesn't trigger POLLHUP (not sure why), instead
read() returns zero. It just prints the following message in a
loop:

    [comm.c:101] Failed to read pw result: Success

Better handle this case in read_comm_reply() by making a difference
between a failed read() and a failed authentication.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On my machine EOF doesn't trigger POLLHUP (not sure why), instead
read() returns zero. It just prints the following message in a
loop:

    [comm.c:101] Failed to read pw result: Success

Better handle this case in read_comm_reply() by making a difference
between a failed read() and a failed authentication.
</pre>
</div>
</content>
</entry>
<entry>
<title>Exit when password handling subprocess crashes</title>
<updated>2024-11-01T21:55:34+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2024-11-01T19:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=96f0a0f9c6a9412fc1886bf54e37ece75b0e9f99'/>
<id>96f0a0f9c6a9412fc1886bf54e37ece75b0e9f99</id>
<content type='text'>
It is better to have swaylock crash immediately and the compositor
show a red screen than to operate in a degraded state where
passwords cannot be checked and the screen cannot be unlocked.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is better to have swaylock crash immediately and the compositor
show a red screen than to operate in a degraded state where
passwords cannot be checked and the screen cannot be unlocked.
</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>
</feed>
