<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dmenu.git/drw.c, branch master</title>
<subtitle>dynamic menu
</subtitle>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/'/>
<entry>
<title>drw.c: drw_scm_free: call free inside</title>
<updated>2025-09-29T16:47:16+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2025-09-29T16:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=8b48986f4c730725367e2865e5ea24931855018f'/>
<id>8b48986f4c730725367e2865e5ea24931855018f</id>
<content type='text'>
Because drw_scm_create() allocates it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because drw_scm_create() allocates it.
</pre>
</div>
</content>
</entry>
<entry>
<title>cleanup schemes and colors</title>
<updated>2025-09-27T10:10:37+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2025-09-27T10:10:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=77f96d704bd16b04fe731da815a4e76c4e62decb'/>
<id>77f96d704bd16b04fe731da815a4e76c4e62decb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid unsigned integer underflow in drw_text()</title>
<updated>2024-10-30T12:02:57+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2024-10-30T12:02:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=dd3d348ae86065edf2d1e2a1bc920685dc4982fc'/>
<id>dd3d348ae86065edf2d1e2a1bc920685dc4982fc</id>
<content type='text'>
Patch by Raymond Cole &lt;rc@wolog.xyz&gt;, thanks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Patch by Raymond Cole &lt;rc@wolog.xyz&gt;, thanks.
</pre>
</div>
</content>
</entry>
<entry>
<title>drw.c: use the same pattern as ellipsis_width to check for infinite recursion</title>
<updated>2024-07-14T09:43:01+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2024-07-14T09:40:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=475d8093cb8d29d5756937bfa9e0b3b9e415f632'/>
<id>475d8093cb8d29d5756937bfa9e0b3b9e415f632</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>render invalid utf8 sequences as U+FFFD</title>
<updated>2024-07-14T09:42:58+00:00</updated>
<author>
<name>NRK</name>
<email>nrk@disroot.org</email>
</author>
<published>2024-07-04T21:27:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=59936c7d972587a47d61161279bb8e8abc0b02f3'/>
<id>59936c7d972587a47d61161279bb8e8abc0b02f3</id>
<content type='text'>
previously drw_text would do the width calculations as if
invalid utf8 sequences were replaced with U+FFFD but would pass
the invalid utf8 sequence to xft to render where xft would just
cut it off at the first invalid byte.

this change makes invalid utf8 render as U+FFFD and avoids
sending invalid sequences to xft. the following can be used to
check the behavior before and after the patch:

	$ printf "0\xef1234567\ntest" | dmenu

Ref: https://lists.suckless.org/dev/2407/35646.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
previously drw_text would do the width calculations as if
invalid utf8 sequences were replaced with U+FFFD but would pass
the invalid utf8 sequence to xft to render where xft would just
cut it off at the first invalid byte.

this change makes invalid utf8 render as U+FFFD and avoids
sending invalid sequences to xft. the following can be used to
check the behavior before and after the patch:

	$ printf "0\xef1234567\ntest" | dmenu

Ref: https://lists.suckless.org/dev/2407/35646.html
</pre>
</div>
</content>
</entry>
<entry>
<title>overhaul utf8decode()</title>
<updated>2024-07-14T09:42:55+00:00</updated>
<author>
<name>NRK</name>
<email>nrk@disroot.org</email>
</author>
<published>2024-07-04T21:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=51e32d49b56c86cd288c64fccf6cd765547781b9'/>
<id>51e32d49b56c86cd288c64fccf6cd765547781b9</id>
<content type='text'>
this changes the utf8decode function to:

* report when an error occurs
* report how many bytes to advance on error

these will be useful in the next commit to render invalid utf8
sequences.

the new implementation is also shorter and more direct.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this changes the utf8decode function to:

* report when an error occurs
* report how many bytes to advance on error

these will be useful in the next commit to render invalid utf8
sequences.

the new implementation is also shorter and more direct.
</pre>
</div>
</content>
</entry>
<entry>
<title>drw: minor improvement to the nomatches cache</title>
<updated>2023-07-07T13:03:57+00:00</updated>
<author>
<name>NRK</name>
<email>nrk@disroot.org</email>
</author>
<published>2023-07-07T11:00:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=7ab0cb5ef0e19352fc5d64ae0d57a5cf4540acbf'/>
<id>7ab0cb5ef0e19352fc5d64ae0d57a5cf4540acbf</id>
<content type='text'>
1. use `unsigned int` to store the codepoints, this avoids waste on
   common case where `long` is 64bits. and POSIX guarantees `int` to be
   at least 32bits so there's no risk of truncation.
2. since switching to `unsigned int` cuts down the memory requirement by
   half, double the cache size from 64 to 128.
3. instead of a linear search, use a simple hash-table for O(1) lookups.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. use `unsigned int` to store the codepoints, this avoids waste on
   common case where `long` is 64bits. and POSIX guarantees `int` to be
   at least 32bits so there's no risk of truncation.
2. since switching to `unsigned int` cuts down the memory requirement by
   half, double the cache size from 64 to 128.
3. instead of a linear search, use a simple hash-table for O(1) lookups.
</pre>
</div>
</content>
</entry>
<entry>
<title>remove workaround for a crash with color emojis on some systems, now fixed in libXft 2.3.5</title>
<updated>2022-09-17T13:32:26+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2022-09-16T21:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=fce06f437dcec646ee0a2728fe695f3084cc6ccb'/>
<id>fce06f437dcec646ee0a2728fe695f3084cc6ccb</id>
<content type='text'>
https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS
</pre>
</div>
</content>
</entry>
<entry>
<title>drw_text: account for fallback fonts in ellipsis_width</title>
<updated>2022-04-16T14:21:01+00:00</updated>
<author>
<name>NRK</name>
<email>nrk@disroot.org</email>
</author>
<published>2022-03-28T15:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=33685b06e9332638769e677e77b257e24e069fd1'/>
<id>33685b06e9332638769e677e77b257e24e069fd1</id>
<content type='text'>
additionally, ellipsis_width (which shouldn't change) is made static to
avoid re-calculating it on each drw_text() call.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
additionally, ellipsis_width (which shouldn't change) is made static to
avoid re-calculating it on each drw_text() call.
</pre>
</div>
</content>
</entry>
<entry>
<title>drw_text: don't segfault when called with 0 width</title>
<updated>2022-04-16T14:21:01+00:00</updated>
<author>
<name>NRK</name>
<email>nrk@disroot.org</email>
</author>
<published>2022-03-27T19:02:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.kartoffeltoaster.de/dmenu.git/commit/?id=e4827b0c4048718ab06670cf60ef68d028fe7fc4'/>
<id>e4827b0c4048718ab06670cf60ef68d028fe7fc4</id>
<content type='text'>
this patch just rejects *any* 0 width draws, which is surely an error by
the caller.

this also guards against cases where the width is too small for the
ellipsis to fit, so ellipsis_w will remain 0.
reported by Bakkeby &lt;bakkeby@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this patch just rejects *any* 0 width draws, which is surely an error by
the caller.

this also guards against cases where the width is too small for the
ellipsis to fit, so ellipsis_w will remain 0.
reported by Bakkeby &lt;bakkeby@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
