dmenu, branch HEAD dynamic menu 8b48986f4c730725367e2865e5ea24931855018f 2025-09-29T16:47:16Z 2025-09-29T16:47:16Z drw.c: drw_scm_free: call free inside Hiltjo Posthuma hiltjo@codemadness.org commit 8b48986f4c730725367e2865e5ea24931855018f parent 77f96d704bd16b04fe731da815a4e76c4e62decb Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 29 Sep 2025 18:47:16 +0200 drw.c: drw_scm_free: call free inside Because drw_scm_create() allocates it. 77f96d704bd16b04fe731da815a4e76c4e62decb 2025-09-27T10:10:37Z 2025-09-27T10:10:37Z cleanup schemes and colors Hiltjo Posthuma hiltjo@codemadness.org commit 77f96d704bd16b04fe731da815a4e76c4e62decb parent d893c63cdd927c33b9b8c9bc52aaa284199a650a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 27 Sep 2025 12:10:37 +0200 cleanup schemes and colors d893c63cdd927c33b9b8c9bc52aaa284199a650a 2025-08-09T12:33:40Z 2025-08-09T12:33:40Z bump version to 5.4 Hiltjo Posthuma hiltjo@codemadness.org commit d893c63cdd927c33b9b8c9bc52aaa284199a650a parent b1e217b29aab8936e9831961943676acd9cdcdd8 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 9 Aug 2025 14:33:40 +0200 bump version to 5.4 b1e217b29aab8936e9831961943676acd9cdcdd8 2025-03-15T18:53:56Z 2025-03-17T20:01:05Z XUngrabKeyboard() instead of XUngrabKey() Adam Purkrt adam@purkrt.cz commit b1e217b29aab8936e9831961943676acd9cdcdd8 parent 86f0b5119eaa39943013d009967432ffd9d18365 Author: Adam Purkrt <adam@purkrt.cz> Date: Sat, 15 Mar 2025 19:53:56 +0100 XUngrabKeyboard() instead of XUngrabKey() XUngrabKey(), which is currently used in cleanup(), is not the right counterpart to XGrabKeyboard(), which is used in grabkeyboard(), called from main(). XUngrabKeyboard() is the function to use, as grabbing the whole keyboard is different to grabbing individual keys. With the current code the keyboard gets ungrabbed, as far as I can tell, only by the final XCloseDisplay() in cleanup(), as the XUngrabKey() there effectively does nothing. 86f0b5119eaa39943013d009967432ffd9d18365 2024-10-30T12:03:25Z 2024-10-30T12:03:25Z remove extra newline Hiltjo Posthuma hiltjo@codemadness.org commit 86f0b5119eaa39943013d009967432ffd9d18365 parent dd3d348ae86065edf2d1e2a1bc920685dc4982fc Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 30 Oct 2024 13:03:25 +0100 remove extra newline dd3d348ae86065edf2d1e2a1bc920685dc4982fc 2024-10-30T12:02:57Z 2024-10-30T12:02:57Z Avoid unsigned integer underflow in drw_text() Hiltjo Posthuma hiltjo@codemadness.org commit dd3d348ae86065edf2d1e2a1bc920685dc4982fc parent 545031a076d4b5712442a8fc2d983f1e9d9f4f79 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 30 Oct 2024 13:02:57 +0100 Avoid unsigned integer underflow in drw_text() Patch by Raymond Cole <rc@wolog.xyz>, thanks. 545031a076d4b5712442a8fc2d983f1e9d9f4f79 2024-10-27T19:08:46Z 2024-10-27T19:08:46Z util.c: output function might override errno and thus affect perror() Hiltjo Posthuma hiltjo@codemadness.org commit 545031a076d4b5712442a8fc2d983f1e9d9f4f79 parent 475d8093cb8d29d5756937bfa9e0b3b9e415f632 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 27 Oct 2024 20:08:46 +0100 util.c: output function might override errno and thus affect perror() Original patch by Raymond Cole with some modifications, thanks! 475d8093cb8d29d5756937bfa9e0b3b9e415f632 2024-07-14T09:40:20Z 2024-07-14T09:43:01Z drw.c: use the same pattern as ellipsis_width to check for infinite recursion Hiltjo Posthuma hiltjo@codemadness.org commit 475d8093cb8d29d5756937bfa9e0b3b9e415f632 parent 59936c7d972587a47d61161279bb8e8abc0b02f3 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 14 Jul 2024 11:40:20 +0200 drw.c: use the same pattern as ellipsis_width to check for infinite recursion 59936c7d972587a47d61161279bb8e8abc0b02f3 2024-07-04T21:27:47Z 2024-07-14T09:42:58Z render invalid utf8 sequences as U+FFFD NRK nrk@disroot.org commit 59936c7d972587a47d61161279bb8e8abc0b02f3 parent 51e32d49b56c86cd288c64fccf6cd765547781b9 Author: NRK <nrk@disroot.org> Date: Thu, 4 Jul 2024 21:27:47 +0000 render invalid utf8 sequences as U+FFFD 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 51e32d49b56c86cd288c64fccf6cd765547781b9 2024-07-04T21:25:37Z 2024-07-14T09:42:55Z overhaul utf8decode() NRK nrk@disroot.org commit 51e32d49b56c86cd288c64fccf6cd765547781b9 parent 7be720cc88ed2294338f7182600df10f21c575ce Author: NRK <nrk@disroot.org> Date: Thu, 4 Jul 2024 21:25:37 +0000 overhaul utf8decode() 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. 7be720cc88ed2294338f7182600df10f21c575ce 2024-03-19T11:12:52Z 2024-03-19T11:12:52Z bump version to 5.3 Hiltjo Posthuma hiltjo@codemadness.org commit 7be720cc88ed2294338f7182600df10f21c575ce parent 8df553e0048733bab4bc85a6b76bcfd44c046e71 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 19 Mar 2024 12:12:52 +0100 bump version to 5.3 8df553e0048733bab4bc85a6b76bcfd44c046e71 2023-09-22T13:16:44Z 2023-09-22T13:16:44Z Makefile: remove the options target Hiltjo Posthuma hiltjo@codemadness.org commit 8df553e0048733bab4bc85a6b76bcfd44c046e71 parent 7ab0cb5ef0e19352fc5d64ae0d57a5cf4540acbf Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 22 Sep 2023 15:16:44 +0200 Makefile: remove the options target The Makefile used to suppress output (by using @), so this target made sense at the time. But the Makefile should be simple and make debugging with less abstractions or fancy printing. The Makefile was made verbose and doesn't hide the build output, so remove this target. Prompted by a question on the mailing list about the options target. 7ab0cb5ef0e19352fc5d64ae0d57a5cf4540acbf 2023-07-07T11:00:42Z 2023-07-07T13:03:57Z drw: minor improvement to the nomatches cache NRK nrk@disroot.org commit 7ab0cb5ef0e19352fc5d64ae0d57a5cf4540acbf parent 0fe460dbd469a1d5b6a7140d0e1801935e4a923b Author: NRK <nrk@disroot.org> Date: Fri, 7 Jul 2023 17:00:42 +0600 drw: minor improvement to the nomatches cache 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. 0fe460dbd469a1d5b6a7140d0e1801935e4a923b 2023-04-05T20:11:49Z 2023-04-06T18:28:56Z fix BadMatch error when embedding on some windows Lucas de Sena lucas@seninha.org commit 0fe460dbd469a1d5b6a7140d0e1801935e4a923b parent dfbbf7f6e1b22ccf9e5a45d77ee10995577fb4fc Author: Lucas de Sena <lucas@seninha.org> Date: Wed, 5 Apr 2023 17:11:49 -0300 fix BadMatch error when embedding on some windows When embedded into another window, dmenu will fail with the BadMatch error if that window have not the same colormap/depth/visual as the root window. That happens because dmenu inherits the colormap/depth/visual from its parent, but draws on a pixmap created based on the root window using a GC created for the root window (see drw.c). A BadMatch will occur when copying the content of the pixmap into dmenu's window. A solution is to create dmenu's window inside root and then reparent it if embeded. See this mail[1] on ports@openbsd.org mailing list for context. [1]: https://marc.info/?l=openbsd-ports&m=168072150814664&w=2 dfbbf7f6e1b22ccf9e5a45d77ee10995577fb4fc 2023-03-08T20:20:52Z 2023-03-08T20:28:51Z readstdin: reduce memory-usage by duplicating the line from getline() Hiltjo Posthuma hiltjo@codemadness.org commit dfbbf7f6e1b22ccf9e5a45d77ee10995577fb4fc parent ba1a347dcaba055f824161007dfee60db3ea785b Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 8 Mar 2023 21:20:52 +0100 readstdin: reduce memory-usage by duplicating the line from getline() Improves upon commit 32db2b125190d366be472ccb7cad833248696144 The getline() implementation often uses a more greedy way of allocating memory. Using this buffer directly and forcing an allocation (by setting it to NULL) would waste a bit of extra space, depending on the implementation of course. Tested on musl libc and glibc. The current glibc version allocates a minimum of 120 bytes per line. For smaller lines musl libc seems less wasteful but still wastes a few bytes per line. On a dmenu_path listing on my system the memory usage was about 350kb (old) vs 30kb (new) on Void Linux glibc. Side-note that getline() also reads NUL bytes in lines, while strdup() would read until the NUL byte. Since dmenu reads text lines either is probably fine(tm). Also rename junk to linesiz. ba1a347dcaba055f824161007dfee60db3ea785b 2022-10-31T10:52:30Z 2022-10-31T10:52:30Z readstdin: allocate amount of items Hiltjo Posthuma hiltjo@codemadness.org commit ba1a347dcaba055f824161007dfee60db3ea785b parent bcbc1ef5c4cf4875a4d66e7dc0919da88a6096a5 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 31 Oct 2022 11:52:30 +0100 readstdin: allocate amount of items Keep track of the amount of items (not a total buffer size), allocate an array of new items. For now change BUFSIZ bytes to 256 * sizeof(struct item)). bcbc1ef5c4cf4875a4d66e7dc0919da88a6096a5 2022-10-31T10:43:34Z 2022-10-31T10:46:10Z readstdin: add a comment Hiltjo Posthuma hiltjo@codemadness.org commit bcbc1ef5c4cf4875a4d66e7dc0919da88a6096a5 parent 689d9bfcf6859e5ce85c296ff0f23b5c08b1fedc Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 31 Oct 2022 11:43:34 +0100 readstdin: add a comment Maybe too obvious / redundant, but OK. 689d9bfcf6859e5ce85c296ff0f23b5c08b1fedc 2022-10-30T18:10:45Z 2022-10-31T10:40:35Z fix leak when getline fails NRK nrk@disroot.org commit 689d9bfcf6859e5ce85c296ff0f23b5c08b1fedc parent e42c03663442f5fb2f66dd59cc5bfdc61c53192c Author: NRK <nrk@disroot.org> Date: Mon, 31 Oct 2022 00:10:45 +0600 fix leak when getline fails according to the getline(3) documentation, the calling code needs to free the buffer even if getline fails. dmenu currently doesn't do that which results in a small leak in case of failure (e.g when piped /dev/null) $ ./dmenu < /dev/null ==8201==ERROR: LeakSanitizer: detected memory leaks Direct leak of 120 byte(s) in 1 object(s) allocated from: #0 0x7f6bf5785ef7 in malloc #1 0x7f6bf538ec84 in __getdelim #2 0x405d0c in readstdin dmenu.c:557 moving `line = NULL` inside the loop body wasn't strictly necessary, but IMO it makes it more apparent that `line` is getting cleared to NULL after each successful iteration. e42c03663442f5fb2f66dd59cc5bfdc61c53192c 2022-10-26T07:43:17Z 2022-10-26T07:43:17Z dmenu: small XmbLookupString code improvements Hiltjo Posthuma hiltjo@codemadness.org commit e42c03663442f5fb2f66dd59cc5bfdc61c53192c parent 1d2b462acf1210b8f86966b8dd9bb6e36e369ee1 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 26 Oct 2022 09:43:17 +0200 dmenu: small XmbLookupString code improvements * Increase the length of composed strings to the same limit as st (32 to 64 bytes). * Initialize ksym to NoSymbol to be safe: currently this is not an issue though. * Add comments to clarify the return values of XmbLookupString a bit. 1d2b462acf1210b8f86966b8dd9bb6e36e369ee1 2022-10-04T17:36:02Z 2022-10-04T17:36:02Z bump version to 5.2 Hiltjo Posthuma hiltjo@codemadness.org commit 1d2b462acf1210b8f86966b8dd9bb6e36e369ee1 parent 7ec32fe4944d4f7137cf2a23366324ffe0f10a70 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 4 Oct 2022 19:36:02 +0200 bump version to 5.2 7ec32fe4944d4f7137cf2a23366324ffe0f10a70 2022-09-26T09:24:15Z 2022-10-01T11:20:40Z dmenu: use die() to print the usage message Tom Schwindl schwindl@posteo.de commit 7ec32fe4944d4f7137cf2a23366324ffe0f10a70 parent fce06f437dcec646ee0a2728fe695f3084cc6ccb Author: Tom Schwindl <schwindl@posteo.de> Date: Mon, 26 Sep 2022 09:24:15 +0000 dmenu: use die() to print the usage message fce06f437dcec646ee0a2728fe695f3084cc6ccb 2022-09-16T21:05:07Z 2022-09-17T13:32:26Z remove workaround for a crash with color emojis on some systems, now fixed in libXft 2.3.5 Hiltjo Posthuma hiltjo@codemadness.org commit fce06f437dcec646ee0a2728fe695f3084cc6ccb parent 1e8c5b68f4881bd4ae257c780fd41f129c79f419 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 16 Sep 2022 23:05:07 +0200 remove workaround for a crash with color emojis on some systems, now fixed in libXft 2.3.5 https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS 1e8c5b68f4881bd4ae257c780fd41f129c79f419 2022-09-02T17:09:50Z 2022-09-02T17:09:50Z fix a regression in the previous commit for tab complete Hiltjo Posthuma hiltjo@codemadness.org commit 1e8c5b68f4881bd4ae257c780fd41f129c79f419 parent 528d39b011afb7ef6fd794ba6b74155d4e69bc68 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 2 Sep 2022 19:09:50 +0200 fix a regression in the previous commit for tab complete Reported by Santtu Lakkala <inz@inz.fi>, thanks! 528d39b011afb7ef6fd794ba6b74155d4e69bc68 2022-09-01T17:51:43Z 2022-09-02T11:00:48Z tab-complete: figure out the size before copying NRK nrk@disroot.org commit 528d39b011afb7ef6fd794ba6b74155d4e69bc68 parent 32db2b125190d366be472ccb7cad833248696144 Author: NRK <nrk@disroot.org> Date: Thu, 1 Sep 2022 23:51:43 +0600 tab-complete: figure out the size before copying we already need to know the string length since `cursor` needs to be adjusted. so just calculate the length beforehand and use `memcpy` to copy exactly as much as needed (as opposed to `strncpy` which always writes `n` bytes). 32db2b125190d366be472ccb7cad833248696144 2022-09-01T18:35:18Z 2022-09-02T10:53:34Z readstdin: use getline(3) NRK nrk@disroot.org commit 32db2b125190d366be472ccb7cad833248696144 parent e35976f4a50f884c2162f71e4128d7c273e3e042 Author: NRK <nrk@disroot.org> Date: Fri, 2 Sep 2022 00:35:18 +0600 readstdin: use getline(3) currently readstdin(): - fgets() into a local buffer, - strchr() the buffer to eleminate the newline - stdups() the buffer into items a simpler way is to just use getline(3), which will do the allocation for us; eliminating the need for stdup()-ing. additionally getline returns back the amount of bytes read, which eliminates the need for strchr()-ing to find the newline. e35976f4a50f884c2162f71e4128d7c273e3e042 2022-08-08T08:42:54Z 2022-08-08T08:42:54Z sync code-style patch from libsl Hiltjo Posthuma hiltjo@codemadness.org commit e35976f4a50f884c2162f71e4128d7c273e3e042 parent 28fb3e28120db29ea45d1951eee7047b4109ab5f Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 8 Aug 2022 10:42:54 +0200 sync code-style patch from libsl 28fb3e28120db29ea45d1951eee7047b4109ab5f 2022-05-01T16:38:25Z 2022-05-01T16:38:25Z Makefile: add manual path for OpenBSD Hiltjo Posthuma hiltjo@codemadness.org commit 28fb3e28120db29ea45d1951eee7047b4109ab5f parent fe5d5c6709a77ac5d554e26dda76a67df68618ae Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 1 May 2022 18:38:25 +0200 Makefile: add manual path for OpenBSD fe5d5c6709a77ac5d554e26dda76a67df68618ae 2022-04-30T11:19:33Z 2022-04-30T11:19:33Z fix incorrect comment, math is hard Hiltjo Posthuma hiltjo@codemadness.org commit fe5d5c6709a77ac5d554e26dda76a67df68618ae parent e1e1de7b3b8399cba90ddca9613f837b2dbef7b9 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 30 Apr 2022 13:19:33 +0200 fix incorrect comment, math is hard e1e1de7b3b8399cba90ddca9613f837b2dbef7b9 2022-04-29T18:15:48Z 2022-04-29T18:18:02Z inputw: improve correctness and startup performance, by NRK Hiltjo Posthuma hiltjo@codemadness.org commit e1e1de7b3b8399cba90ddca9613f837b2dbef7b9 parent 33685b06e9332638769e677e77b257e24e069fd1 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 29 Apr 2022 20:15:48 +0200 inputw: improve correctness and startup performance, by NRK Always use ~30% of the monitor width for the input in horizontal mode. Patch adapted from NRK patches. This also does not calculate inputw when using vertical mode anymore (because the code is removed). 33685b06e9332638769e677e77b257e24e069fd1 2022-03-28T15:38:49Z 2022-04-16T14:21:01Z drw_text: account for fallback fonts in ellipsis_width NRK nrk@disroot.org commit 33685b06e9332638769e677e77b257e24e069fd1 parent e4827b0c4048718ab06670cf60ef68d028fe7fc4 Author: NRK <nrk@disroot.org> Date: Mon, 28 Mar 2022 21:38:49 +0600 drw_text: account for fallback fonts in ellipsis_width additionally, ellipsis_width (which shouldn't change) is made static to avoid re-calculating it on each drw_text() call. e4827b0c4048718ab06670cf60ef68d028fe7fc4 2022-03-27T19:02:52Z 2022-04-16T14:21:01Z drw_text: don't segfault when called with 0 width NRK nrk@disroot.org commit e4827b0c4048718ab06670cf60ef68d028fe7fc4 parent e73651f12a406629778f02d8e5acbe2caec0dfc2 Author: NRK <nrk@disroot.org> Date: Mon, 28 Mar 2022 01:02:52 +0600 drw_text: don't segfault when called with 0 width 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 <bakkeby@gmail.com> e73651f12a406629778f02d8e5acbe2caec0dfc2 2022-03-26T16:58:47Z 2022-03-26T16:58:47Z fix UB with the function iscntrl() Hiltjo Posthuma hiltjo@codemadness.org commit e73651f12a406629778f02d8e5acbe2caec0dfc2 parent 31fa07b9849b0ffbf4b7efb55943f466b3ff160f Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 26 Mar 2022 17:58:47 +0100 fix UB with the function iscntrl() From commit 6818e07291f3b2913e687c8ec3d3fe4711724050 by NRK, thanks 31fa07b9849b0ffbf4b7efb55943f466b3ff160f 2022-03-26T16:57:50Z 2022-03-26T16:57:50Z Revert "avoid redraw when there's no change" Hiltjo Posthuma hiltjo@codemadness.org commit 31fa07b9849b0ffbf4b7efb55943f466b3ff160f parent 6818e07291f3b2913e687c8ec3d3fe4711724050 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 26 Mar 2022 17:57:50 +0100 Revert "avoid redraw when there's no change" This reverts commit 6818e07291f3b2913e687c8ec3d3fe4711724050. This broke keys such as ^W to delete-backward-word 6818e07291f3b2913e687c8ec3d3fe4711724050 2022-03-25T21:51:45Z 2022-03-25T21:53:50Z avoid redraw when there's no change NRK nrk@disroot.org commit 6818e07291f3b2913e687c8ec3d3fe4711724050 parent b43ec0577f2ad8ad33a0b893fe5360d966036786 Author: NRK <nrk@disroot.org> Date: Fri, 25 Mar 2022 22:51:45 +0100 avoid redraw when there's no change while i was timing the performance issue, i noticed that there was lots of random redrawing going on. turns out there were coming from here; if someone presses CTRL/ALT etc without pressing anything else, nothing will be inserted, so nothing will change. but the code will `break`, go down and do a needless redraw. this patch changes it to simply return if the keypress iscntrl() also avoid potential UB by casting *buf into an unsigned char. b43ec0577f2ad8ad33a0b893fe5360d966036786 2022-03-25T21:51:09Z 2022-03-25T21:53:50Z free all allocated items, use %zu for size_t NRK nrk@disroot.org commit b43ec0577f2ad8ad33a0b893fe5360d966036786 parent 22511c41d55a38a770541ae617a09383d5e6ad1c Author: NRK <nrk@disroot.org> Date: Fri, 25 Mar 2022 22:51:09 +0100 free all allocated items, use %zu for size_t `items` itself is not checked for NULL as calling free on NULL is defined to be a no-op. 22511c41d55a38a770541ae617a09383d5e6ad1c 2022-03-23T18:37:55Z 2022-03-25T21:49:07Z drw_text: improve performance when there's no match NRK nrk@disroot.org commit 22511c41d55a38a770541ae617a09383d5e6ad1c parent 77526f756e23e362081ac807521f901f2e5cd5e6 Author: NRK <nrk@disroot.org> Date: Thu, 24 Mar 2022 00:37:55 +0600 drw_text: improve performance when there's no match this was the last piece of the puzzle, the case where we can't find any font to draw the codepoint. in such cases, we use XftFontMatch() which is INSANELY slow. but that's not the real problem. the real problem was we were continuously trying to match the same thing over and over again. this patch introduces a small cache, which keeps track a couple codepoints for which we know we won't find any matches. with this, i can dump lots of emojies into dmenu where some of them don't have any matching font, and still not have dmenu lag insanely or FREEZE completely when scrolling up and down. this also improves startup time, which will of course depend on the system and all installed fonts; but on my system and test case i see the following startup time drop: before -> after 60ms -> 34ms 77526f756e23e362081ac807521f901f2e5cd5e6 2022-03-23T18:37:55Z 2022-03-25T21:49:07Z inputw: improve correctness and startup performance NRK nrk@disroot.org commit 77526f756e23e362081ac807521f901f2e5cd5e6 parent 7269c5355d257dd2ad2c53f15dc9c1cf6796aea5 Author: NRK <nrk@disroot.org> Date: Thu, 24 Mar 2022 00:37:55 +0600 inputw: improve correctness and startup performance a massive amount of time inside readstdin() is spent trying to get the max input width and then put it into inputw, only for it to get clamped down to mw/3 inside setup(). it makes more sense to calculate inputw inside setup() once we have mw available. similar to the last patch, i see noticeable startup performance improvement: before -> after 160ms -> 60ms additionally this will take fallback fonts into account compared to the previous version, so it's not only more performant but also more correct. 7269c5355d257dd2ad2c53f15dc9c1cf6796aea5 2022-03-23T20:04:04Z 2022-03-25T21:49:07Z significantly improve performance on large strings NRK nrk@disroot.org commit 7269c5355d257dd2ad2c53f15dc9c1cf6796aea5 parent 6be057f060543bb0f3ed9423904263617cdffffe Author: NRK <nrk@disroot.org> Date: Thu, 24 Mar 2022 02:04:04 +0600 significantly improve performance on large strings this replaces inefficient pattern of `MIN(TEXTW(..), n)` with drw_fontset_getwidth_clamp() instead, which is far more efficient when we only want up to a certain width. dumping a decently sized (unicode) emoji file into dmenu, I see the startup time drop significantly with this patch. before -> after 360ms -> 160ms this should also noticeably improve input latency (responsiveness) given that calcoffsets() and drawmenu() are pretty hot functions. 6be057f060543bb0f3ed9423904263617cdffffe 2022-03-23T20:00:00Z 2022-03-25T21:49:07Z introduce drw_fontset_getwidth_clamp() NRK nrk@disroot.org commit 6be057f060543bb0f3ed9423904263617cdffffe parent 41fdabbf7c517f8d524b70cbd78238cc319ccef3 Author: NRK <nrk@disroot.org> Date: Thu, 24 Mar 2022 02:00:00 +0600 introduce drw_fontset_getwidth_clamp() getting the width of a string is an O(n) operation, and in many cases users only care about getting the width upto a certain number. instead of calling drw_fontset_getwidth() and *then* clamping the result, this patch introduces drw_fontset_getwidth_clamp() function, similar to strnlen(), which will stop once we reach n. the `invert` parameter was overloaded internally to preserve the API, however library users should be calling drw_fontset_getwidth_clamp() and not depend upon internal behavior of drw_text(). 41fdabbf7c517f8d524b70cbd78238cc319ccef3 2022-03-23T18:37:55Z 2022-03-25T21:49:07Z drw_text: improve both performance and correctness NRK nrk@disroot.org commit 41fdabbf7c517f8d524b70cbd78238cc319ccef3 parent 3a505cebe8adab204e5619357e0bfe3f9f3a92ff Author: NRK <nrk@disroot.org> Date: Thu, 24 Mar 2022 00:37:55 +0600 drw_text: improve both performance and correctness this patch makes some non-trivial changes, which significantly improves the performance of drawing large strings as well as fixes any issues regarding the printing of the ellipsis when string gets truncated. * performance: before there were two O(n) loops, one which finds how long we can go without changing font, and the second loop would (incorrectly) truncate the string if it's too big. this patch merges the overflow calculation into the first loop and exits out when overflow is detected. when dumping lots of emojies into dmenu, i see some noticeable startup time improvement: before -> after 460ms -> 360ms input latency when scrolling up/down is also noticeably better and can be tested with the following: for _ in $(seq 20); do cat /dev/urandom | base64 | tr -d '\n' | head -c 1000000 echo done | ./dmenu -l 10 * correctness: the previous version would incorrectly assumed single byte chars and would overwrite them with '.' , this caused a whole bunch of obvious problems, including the ellipsis not getting rendered if then font changed. in addition to exiting out when we detect overflow, this patch also keeps track of the last x-position where the ellipsis would fit. if we detect overflow, we simply make a recursing call to drw_text() at the ellipsis_x position and overwrite what was there. so now the ellipsis will always be printed properly, regardless of weather the font changes or if the string is single byte char or not. the idea of rendering the ellipsis on top incase of overflow was from Bakkeby <bakkeby@gmail.com>, thanks! however the original patch had some issues incorrectly truncating the prompt (-p flag) and cutting off emojies. those have been fixed in here. 3a505cebe8adab204e5619357e0bfe3f9f3a92ff 2022-03-01T21:45:39Z 2022-03-01T21:45:39Z remove false-positive warning for int comparison as bool Hiltjo Posthuma hiltjo@codemadness.org commit 3a505cebe8adab204e5619357e0bfe3f9f3a92ff parent 308fe78b83836371720c7d7eb2c3eac409f3cc16 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 1 Mar 2022 22:45:39 +0100 remove false-positive warning for int comparison as bool Reported by Prathu Baronia <prathu.baronia@praton.me>, patch slightly changed. Thanks! 308fe78b83836371720c7d7eb2c3eac409f3cc16 2022-02-11T11:26:35Z 2022-02-11T11:26:35Z bump version to 5.1 Hiltjo Posthuma hiltjo@codemadness.org commit 308fe78b83836371720c7d7eb2c3eac409f3cc16 parent c4b656e0da36070a834b03ceb76269ffee8ac952 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 11 Feb 2022 12:26:35 +0100 bump version to 5.1 c4b656e0da36070a834b03ceb76269ffee8ac952 2022-02-08T20:45:28Z 2022-02-08T20:45:28Z code-style: rm newline (oops) Hiltjo Posthuma hiltjo@codemadness.org commit c4b656e0da36070a834b03ceb76269ffee8ac952 parent 3e39c526d28582b0b5606d3e3bb36ee3d271e616 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 8 Feb 2022 21:45:28 +0100 code-style: rm newline (oops) 3e39c526d28582b0b5606d3e3bb36ee3d271e616 2022-02-08T18:32:25Z 2022-02-08T18:38:23Z revert using strcasestr and use a more optimized portable version Hiltjo Posthuma hiltjo@codemadness.org commit 3e39c526d28582b0b5606d3e3bb36ee3d271e616 parent a9a3836861bd23387b5a51d6f6ac23377e98e26f Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 8 Feb 2022 19:32:25 +0100 revert using strcasestr and use a more optimized portable version ... compared to the old cistrstr(). Thanks for the feedback! a9a3836861bd23387b5a51d6f6ac23377e98e26f 2022-02-07T09:36:13Z 2022-02-07T09:36:13Z follow-up fix: add -D_GNU_SOURCE for strcasestr for some systems Hiltjo Posthuma hiltjo@codemadness.org commit a9a3836861bd23387b5a51d6f6ac23377e98e26f parent eb96af27f4059c93d7e000e910b71d74829a239b Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 7 Feb 2022 10:36:13 +0100 follow-up fix: add -D_GNU_SOURCE for strcasestr for some systems eb96af27f4059c93d7e000e910b71d74829a239b 2022-02-06T23:21:12Z 2022-02-06T23:21:12Z improve performance of case-insensitive matching Hiltjo Posthuma hiltjo@codemadness.org commit eb96af27f4059c93d7e000e910b71d74829a239b parent d78ff08d99780a73447d5a95bf1e358e8c23aa3c Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 7 Feb 2022 00:21:12 +0100 improve performance of case-insensitive matching d78ff08d99780a73447d5a95bf1e358e8c23aa3c 2021-08-20T21:05:53Z 2021-08-20T21:05:53Z Revert "Improve speed of drw_text when provided with large strings" Hiltjo Posthuma hiltjo@codemadness.org commit d78ff08d99780a73447d5a95bf1e358e8c23aa3c parent cd2133a5f66b42f992a9a1b92bbbce11dc26b941 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 20 Aug 2021 23:05:53 +0200 Revert "Improve speed of drw_text when provided with large strings" This reverts commit c585e8e498ec6f9c423ab8ea07cf853ee5b05fbe. It causes issues with truncation of characters when the text does not fit and so on. The patch should be reworked and properly tested. cd2133a5f66b42f992a9a1b92bbbce11dc26b941 2021-08-09T16:39:25Z 2021-08-09T16:39:25Z add support for more keypad keys Hiltjo Posthuma hiltjo@codemadness.org commit cd2133a5f66b42f992a9a1b92bbbce11dc26b941 parent c585e8e498ec6f9c423ab8ea07cf853ee5b05fbe Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 9 Aug 2021 18:39:25 +0200 add support for more keypad keys The keypad Enter key was already supported. On some keyboard layouts like my laptop the page-up and page-down key is more comfortable to use. This adds a few lines but no complexity. c585e8e498ec6f9c423ab8ea07cf853ee5b05fbe 2021-08-08T01:34:35Z 2021-08-09T16:20:51Z Improve speed of drw_text when provided with large strings Miles Alan m@milesalan.com commit c585e8e498ec6f9c423ab8ea07cf853ee5b05fbe parent 523aa08f51a88c59ad4b1f600f8ce3d122e9e289 Author: Miles Alan <m@milesalan.com> Date: Sat, 7 Aug 2021 21:34:35 -0400 Improve speed of drw_text when provided with large strings Calculates len & ew in drw_font_getexts loop by incrementing instead of decrementing; as such avoids proportional increase in time spent in loop based on provided strings size. 523aa08f51a88c59ad4b1f600f8ce3d122e9e289 2021-07-25T01:55:25Z 2021-07-25T08:55:45Z remove always true condition in if statement Guilherme Janczak guilherme.janczak@yandex.com commit 523aa08f51a88c59ad4b1f600f8ce3d122e9e289 parent 1a13d0465d1a6f4f74bc5b07b04c9bd542f20ba6 Author: Guilherme Janczak <guilherme.janczak@yandex.com> Date: Sun, 25 Jul 2021 01:55:25 +0000 remove always true condition in if statement 1a13d0465d1a6f4f74bc5b07b04c9bd542f20ba6 2020-09-02T16:30:56Z 2020-09-02T16:31:23Z bump version to 5.0 Hiltjo Posthuma hiltjo@codemadness.org commit 1a13d0465d1a6f4f74bc5b07b04c9bd542f20ba6 parent 9b38fda6feda68f95754d5b8932b1a69471df960 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 2 Sep 2020 18:30:56 +0200 bump version to 5.0 ... and bump LICENSE year. 9b38fda6feda68f95754d5b8932b1a69471df960 2020-06-11T16:45:33Z 2020-06-11T16:45:33Z Fix memory leaks in drw Hiltjo Posthuma hiltjo@codemadness.org commit 9b38fda6feda68f95754d5b8932b1a69471df960 parent db6093f6ec1bb884f7540f2512935b5254750b30 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 11 Jun 2020 18:45:33 +0200 Fix memory leaks in drw Synced from dwm. Patch by Alex Flierl <shad0w73@freenet.de>, thanks. db6093f6ec1bb884f7540f2512935b5254750b30 2019-03-03T12:08:54Z 2019-03-03T12:08:54Z revert IME support Hiltjo Posthuma hiltjo@codemadness.org commit db6093f6ec1bb884f7540f2512935b5254750b30 parent a9b1de384ae1ad30805e893af5cd6ea9b87c89da Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 3 Mar 2019 13:08:54 +0100 revert IME support dmenu will not handle IME support (st will, atleast for now). revert parts of commit 377bd37e212b1ec4c03a481245603c6560d0be22 this commit also broke input focus. a9b1de384ae1ad30805e893af5cd6ea9b87c89da 2019-02-12T21:58:35Z 2019-02-12T21:58:35Z improve xopenim error message Hiltjo Posthuma hiltjo@codemadness.org commit a9b1de384ae1ad30805e893af5cd6ea9b87c89da parent 43b0c2c3dd3e694cf674097d493ef6630efc5403 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 12 Feb 2019 22:58:35 +0100 improve xopenim error message die() already prints a newline. 43b0c2c3dd3e694cf674097d493ef6630efc5403 2019-02-12T21:13:58Z 2019-02-12T21:13:58Z make dmenu_path script executable Hiltjo Posthuma hiltjo@codemadness.org commit 43b0c2c3dd3e694cf674097d493ef6630efc5403 parent f5036b90efd9423d805923a0bc73cd54e30e72ab Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 12 Feb 2019 22:13:58 +0100 make dmenu_path script executable (as dmenu_run is) f5036b90efd9423d805923a0bc73cd54e30e72ab 2019-02-12T18:10:43Z 2019-02-12T18:10:43Z fix crash when XOpenIM returns NULL Hiltjo Posthuma hiltjo@codemadness.org commit f5036b90efd9423d805923a0bc73cd54e30e72ab parent 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 12 Feb 2019 19:10:43 +0100 fix crash when XOpenIM returns NULL for example when IME variables are set, but the program is not started (yet). 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 2019-02-03T23:29:26Z 2019-02-04T18:49:34Z Close when the embedding window is destroyed Quentin Rameau quinq@fifth.space commit 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 parent 65be875f5adf31e9c4762ac8a8d74b1dfdd78584 Author: Quentin Rameau <quinq@fifth.space> Date: Mon, 4 Feb 2019 00:29:26 +0100 Close when the embedding window is destroyed 65be875f5adf31e9c4762ac8a8d74b1dfdd78584 2019-02-02T12:54:15Z 2019-02-02T12:54:15Z Prepared 4.9 release. Anselm R Garbe anselm@garbe.ca commit 65be875f5adf31e9c4762ac8a8d74b1dfdd78584 parent 7d19b2055d98e5c0249efe582c852b8b8b30cd41 Author: Anselm R Garbe <anselm@garbe.ca> Date: Sat, 2 Feb 2019 04:54:15 -0800 Prepared 4.9 release. 7d19b2055d98e5c0249efe582c852b8b8b30cd41 2019-01-27T14:28:02Z 2019-01-27T14:28:02Z dmenu.1: document improved fastgrab behaviour from previous patch Hiltjo Posthuma hiltjo@codemadness.org commit 7d19b2055d98e5c0249efe582c852b8b8b30cd41 parent 11a65377da8fc198d15cf041dbbbb9718e5798cd Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 27 Jan 2019 15:28:02 +0100 dmenu.1: document improved fastgrab behaviour from previous patch 11a65377da8fc198d15cf041dbbbb9718e5798cd 2019-01-26T14:49:15Z 2019-01-27T14:26:04Z Use slow path if stdin is a tty dok dok@grehack.fr commit 11a65377da8fc198d15cf041dbbbb9718e5798cd parent bbc464dc80225b8cf9390f14fac6c682f63940d2 Author: dok <dok@grehack.fr> Date: Sat, 26 Jan 2019 15:49:15 +0100 Use slow path if stdin is a tty If stdin is a tty and dmenu is ran with the fast option then it's impossible to close stdin because the keyboard is already grabbed. bbc464dc80225b8cf9390f14fac6c682f63940d2 2018-07-21T10:47:43Z 2018-07-21T10:49:00Z dmenu_path: always use the cachedir Quentin Rameau quinq@fifth.space commit bbc464dc80225b8cf9390f14fac6c682f63940d2 parent a314412f4b80af5100901344856a341f8ea4cc7a Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 21 Jul 2018 12:47:43 +0200 dmenu_path: always use the cachedir a314412f4b80af5100901344856a341f8ea4cc7a 2018-06-02T15:09:01Z 2018-06-02T15:09:01Z Makefile: just show the compiler output Hiltjo Posthuma hiltjo@codemadness.org commit a314412f4b80af5100901344856a341f8ea4cc7a parent a9eae39e934d8dab7f1772570efb5f25825bfe01 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 2 Jun 2018 17:09:01 +0200 Makefile: just show the compiler output Don't be fancy and just show the actual output so debugging is simpler. a9eae39e934d8dab7f1772570efb5f25825bfe01 2018-06-02T15:01:24Z 2018-06-02T15:01:24Z Do not strip at link stage Hiltjo Posthuma hiltjo@codemadness.org commit a9eae39e934d8dab7f1772570efb5f25825bfe01 parent 851b73d178c8d7665c6d8a0bc34dbd4f9d1aa77b Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 2 Jun 2018 17:01:24 +0200 Do not strip at link stage Building with debug symbols is worthless unless LDFLAGS are manually adjusted as well. 851b73d178c8d7665c6d8a0bc34dbd4f9d1aa77b 2018-05-25T11:07:17Z 2018-05-25T11:07:17Z code-style for pledge: check the return code -1, not < 0 Hiltjo Posthuma hiltjo@codemadness.org commit 851b73d178c8d7665c6d8a0bc34dbd4f9d1aa77b parent 05c138f5b8f19070a190b97728c83b454855f52b Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 25 May 2018 13:07:17 +0200 code-style for pledge: check the return code -1, not < 0 this is the proper idiom 05c138f5b8f19070a190b97728c83b454855f52b 2018-05-25T11:03:25Z 2018-05-25T11:03:25Z code-style for pledge(2) Hiltjo Posthuma hiltjo@codemadness.org commit 05c138f5b8f19070a190b97728c83b454855f52b parent cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 25 May 2018 13:03:25 +0200 code-style for pledge(2) feedback from Klemens, thanks cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c 2018-05-25T10:04:22Z 2018-05-25T10:04:22Z Pledge on OpenBSD Hiltjo Posthuma hiltjo@codemadness.org commit cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c parent e75494b730ea6883e68072a106a09a301cfaf845 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 25 May 2018 12:04:22 +0200 Pledge on OpenBSD e75494b730ea6883e68072a106a09a301cfaf845 2018-05-09T19:27:29Z 2018-05-12T17:12:25Z Use bold for keyboard shortcuts in dmenu.1 David Demelier markand@malikania.fr commit e75494b730ea6883e68072a106a09a301cfaf845 parent 0f76dd2fb89748eb5460adbc87c4e98bcce09763 Author: David Demelier <markand@malikania.fr> Date: Wed, 9 May 2018 21:27:29 +0200 Use bold for keyboard shortcuts in dmenu.1 Like dwm, use the same syntax for all keyboard shortcuts for consistency. 0f76dd2fb89748eb5460adbc87c4e98bcce09763 2018-04-22T12:18:34Z 2018-04-22T12:19:20Z Fix cursor drawn position with wide glyphs Quentin Rameau quinq@fifth.space commit 0f76dd2fb89748eb5460adbc87c4e98bcce09763 parent 0b5748021877b2f214474b034d8bf0122ee88ed2 Author: Quentin Rameau <quinq@fifth.space> Date: Sun, 22 Apr 2018 14:18:34 +0200 Fix cursor drawn position with wide glyphs 0b5748021877b2f214474b034d8bf0122ee88ed2 2018-03-22T10:18:56Z 2018-04-22T12:09:05Z Makefile: bikesheddingly replace ${} with $() Quentin Rameau quinq@fifth.space commit 0b5748021877b2f214474b034d8bf0122ee88ed2 parent 377bd37e212b1ec4c03a481245603c6560d0be22 Author: Quentin Rameau <quinq@fifth.space> Date: Thu, 22 Mar 2018 11:18:56 +0100 Makefile: bikesheddingly replace ${} with $() 377bd37e212b1ec4c03a481245603c6560d0be22 2018-03-19T14:42:28Z 2018-04-22T12:09:05Z Handle IME input Quentin Rameau quinq@fifth.space commit 377bd37e212b1ec4c03a481245603c6560d0be22 parent b6d2cc9aea979cb3557db39dbe65a2870d13e597 Author: Quentin Rameau <quinq@fifth.space> Date: Mon, 19 Mar 2018 15:42:28 +0100 Handle IME input Thanks to nzl <uruabi@gmail.com> for the patch! b6d2cc9aea979cb3557db39dbe65a2870d13e597 2018-03-16T15:51:22Z 2018-04-22T12:09:05Z Fix handling of input strings Hiltjo Posthuma hiltjo@codemadness.org commit b6d2cc9aea979cb3557db39dbe65a2870d13e597 parent 2f398981feb562285b0a96cd315bf2b3244c7309 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 16 Mar 2018 16:51:22 +0100 Fix handling of input strings 2f398981feb562285b0a96cd315bf2b3244c7309 2018-03-15T09:16:10Z 2018-03-15T17:29:32Z Update LICENSE Quentin Rameau quinq@fifth.space commit 2f398981feb562285b0a96cd315bf2b3244c7309 parent 23051d78dd80468042e2a5095533ec68bfb43a51 Author: Quentin Rameau <quinq@fifth.space> Date: Thu, 15 Mar 2018 10:16:10 +0100 Update LICENSE Only "meaningful" commits and contributors who made changes over the years have been added. 23051d78dd80468042e2a5095533ec68bfb43a51 2018-03-14T18:48:05Z 2018-03-14T18:48:05Z bump version to 4.8 Hiltjo Posthuma hiltjo@codemadness.org commit 23051d78dd80468042e2a5095533ec68bfb43a51 parent e2a280541eab62717d6a9a72d047c832e5cb1edc Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 14 Mar 2018 19:48:05 +0100 bump version to 4.8 e2a280541eab62717d6a9a72d047c832e5cb1edc 2018-03-13T16:15:09Z 2018-03-13T19:10:46Z add key bindings for moving to the word start or end Quentin Rameau quinq@fifth.space commit e2a280541eab62717d6a9a72d047c832e5cb1edc parent 889512811d7ae410eb4ab60be3568278b3e23f2e Author: Quentin Rameau <quinq@fifth.space> Date: Tue, 13 Mar 2018 17:15:09 +0100 add key bindings for moving to the word start or end Mod1+b/^Left and Mod1+f/^Right 889512811d7ae410eb4ab60be3568278b3e23f2e 2018-01-04T22:45:49Z 2018-01-04T22:45:49Z Fix regression in 84a1bc5 Hiltjo Posthuma hiltjo@codemadness.org commit 889512811d7ae410eb4ab60be3568278b3e23f2e parent 84a1bc5d0d6b54eb23268e8f02a787be9ccbd919 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 4 Jan 2018 23:45:49 +0100 Fix regression in 84a1bc5 Reported by Jochen Sprickerhof, thanks! Applied patch with minor change (only initialize `i` for XINERAMA). 84a1bc5d0d6b54eb23268e8f02a787be9ccbd919 2018-01-04T12:27:37Z 2018-01-04T17:14:41Z Instantiate j var outside #ifdef XINEMARA directive because it is used in loop outside directive Vincent Carluer vince@bitfu.io commit 84a1bc5d0d6b54eb23268e8f02a787be9ccbd919 parent f0a5b75d6a0d2a62da45e9f65d92ea4a6a2d5831 Author: Vincent Carluer <vince@bitfu.io> Date: Thu, 4 Jan 2018 12:27:37 +0000 Instantiate j var outside #ifdef XINEMARA directive because it is used in loop outside directive f0a5b75d6a0d2a62da45e9f65d92ea4a6a2d5831 2017-11-03T20:10:38Z 2017-11-03T20:10:38Z drw: drw_scm_create: use Clr type Hiltjo Posthuma hiltjo@codemadness.org commit f0a5b75d6a0d2a62da45e9f65d92ea4a6a2d5831 parent 1cabeda5505dcc35d4d2ca2a09151a7c449fb401 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 3 Nov 2017 21:10:38 +0100 drw: drw_scm_create: use Clr type in this context XftColor is a too low-level type. 1cabeda5505dcc35d4d2ca2a09151a7c449fb401 2017-11-03T14:31:37Z 2017-11-03T20:07:02Z fix a possible free of a uninitialize variable in paste() Hiltjo Posthuma hiltjo@codemadness.org commit 1cabeda5505dcc35d4d2ca2a09151a7c449fb401 parent 41379f7c39e6aa0a17d7807b22b49ea148f5b0fa Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 3 Nov 2017 15:31:37 +0100 fix a possible free of a uninitialize variable in paste() 41379f7c39e6aa0a17d7807b22b49ea148f5b0fa 2017-11-03T20:05:29Z 2017-11-03T20:05:29Z init colors using SchemeLast Hiltjo Posthuma hiltjo@codemadness.org commit 41379f7c39e6aa0a17d7807b22b49ea148f5b0fa parent 64ab2801fbbbcc028c359080ae4bd546fc871f67 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 3 Nov 2017 21:05:29 +0100 init colors using SchemeLast this makes it slightly easier to add colors to schemes. 64ab2801fbbbcc028c359080ae4bd546fc871f67 2017-11-03T16:49:10Z 2017-11-03T19:41:03Z Set class name on menu window Omar Sandoval osandov@osandov.com commit 64ab2801fbbbcc028c359080ae4bd546fc871f67 parent f428f3e01a4ced5b1df07ddf913bb022692f8035 Author: Omar Sandoval <osandov@osandov.com> Date: Fri, 3 Nov 2017 09:49:10 -0700 Set class name on menu window WM_CLASS is a standard ICCCM property which is used to identify windows. Window managers and compositors use it to allow per-application configurable behavior. f428f3e01a4ced5b1df07ddf913bb022692f8035 2017-05-02T16:32:04Z 2017-05-02T16:32:04Z release 4.7 Hiltjo Posthuma hiltjo@codemadness.org commit f428f3e01a4ced5b1df07ddf913bb022692f8035 parent 5cd66e2c6ca6a82e59927d495498fa6e478594d6 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 2 May 2017 18:32:04 +0200 release 4.7 5cd66e2c6ca6a82e59927d495498fa6e478594d6 2016-12-07T14:45:01Z 2016-12-11T11:33:16Z Revert "fix input text matching" Andrew Gregory andrew.gregory.8@gmail.com commit 5cd66e2c6ca6a82e59927d495498fa6e478594d6 parent e90b88e12a88d6214c00d5ee58ceb69446aa5ac4 Author: Andrew Gregory <andrew.gregory.8@gmail.com> Date: Wed, 7 Dec 2016 09:45:01 -0500 Revert "fix input text matching" This reverts commit 09d0a36e0370f7ca9bdb171bf93c5ac3131c5a92. Using strncmp with the length of the user input turns it into a prefix match rather than an exact match as it's supposed to be. e90b88e12a88d6214c00d5ee58ceb69446aa5ac4 2016-11-25T12:38:09Z 2016-11-25T13:21:40Z Xinerama: correct variable declarations in preprocessor conditional Thomas Gardner tmg@fastmail.com commit e90b88e12a88d6214c00d5ee58ceb69446aa5ac4 parent a280bdad1f16943a70eaff086852d3b11043b060 Author: Thomas Gardner <tmg@fastmail.com> Date: Fri, 25 Nov 2016 22:38:09 +1000 Xinerama: correct variable declarations in preprocessor conditional a280bdad1f16943a70eaff086852d3b11043b060 2016-11-05T10:36:42Z 2016-11-05T10:36:42Z die() on calloc failure Hiltjo Posthuma hiltjo@codemadness.org commit a280bdad1f16943a70eaff086852d3b11043b060 parent a9a5c6cc2d7d55ed7e556a4fe9d75307c6df2e84 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 5 Nov 2016 11:36:42 +0100 die() on calloc failure thanks Markus Teich and David! a9a5c6cc2d7d55ed7e556a4fe9d75307c6df2e84 2016-10-08T12:08:28Z 2016-10-14T13:26:35Z add embedding support with -w option Quentin Rameau quinq@fifth.space commit a9a5c6cc2d7d55ed7e556a4fe9d75307c6df2e84 parent a97f550aa7b81d2add1d2a99e594c038da01fc19 Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 8 Oct 2016 14:08:28 +0200 add embedding support with -w option a97f550aa7b81d2add1d2a99e594c038da01fc19 2016-10-08T12:42:53Z 2016-10-14T13:26:34Z dmenu.1: group single options Quentin Rameau quinq@fifth.space commit a97f550aa7b81d2add1d2a99e594c038da01fc19 parent ff8daf88475960f6ccc4e3ded3214147ecb21809 Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 8 Oct 2016 14:42:53 +0200 dmenu.1: group single options ff8daf88475960f6ccc4e3ded3214147ecb21809 2016-10-08T12:36:04Z 2016-10-14T13:26:34Z dmenu.1: fix -l option Quentin Rameau quinq@fifth.space commit ff8daf88475960f6ccc4e3ded3214147ecb21809 parent 026827fd65c1163a92a984c4eae3882a6d69f8df Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 8 Oct 2016 14:36:04 +0200 dmenu.1: fix -l option 026827fd65c1163a92a984c4eae3882a6d69f8df 2016-08-12T12:39:30Z 2016-08-12T12:39:30Z die() consistency: always add newline Hiltjo Posthuma hiltjo@codemadness.org commit 026827fd65c1163a92a984c4eae3882a6d69f8df parent d14670b9959f8b3760b63dd40a70687a90312b8a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 12 Aug 2016 14:39:30 +0200 die() consistency: always add newline d14670b9959f8b3760b63dd40a70687a90312b8a 2016-07-26T21:13:06Z 2016-07-26T21:13:06Z fix crash if negative monitor (< -1) was passed Hiltjo Posthuma hiltjo@codemadness.org commit d14670b9959f8b3760b63dd40a70687a90312b8a parent aa92cd68bdff95c181cc854043598e6c6007d45e Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 26 Jul 2016 23:13:06 +0200 fix crash if negative monitor (< -1) was passed for example: dmenu -m '-9001' aa92cd68bdff95c181cc854043598e6c6007d45e 2016-07-26T21:02:34Z 2016-07-26T21:02:34Z Revert "Print highlighted input text only on single match" Hiltjo Posthuma hiltjo@codemadness.org commit aa92cd68bdff95c181cc854043598e6c6007d45e parent a4053bc4e403ae57343f43b7e363a0911bba5a3a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 26 Jul 2016 23:02:34 +0200 Revert "Print highlighted input text only on single match" This reverts commit a4053bc4e403ae57343f43b7e363a0911bba5a3a. My bad, was working on the wrong branch and accidently pushed it... *facepalm* a4053bc4e403ae57343f43b7e363a0911bba5a3a 2016-07-26T10:48:23Z 2016-07-26T16:29:42Z Print highlighted input text only on single match Quentin Rameau quinq@fifth.space commit a4053bc4e403ae57343f43b7e363a0911bba5a3a parent 657122f7819fd74d66706ffb607deb44884401b7 Author: Quentin Rameau <quinq@fifth.space> Date: Tue, 26 Jul 2016 12:48:23 +0200 Print highlighted input text only on single match When the input text fully matches a single item, do not draw the item and highlight the input text to show that it matches an item in opposition to regular input text not matching anything. 657122f7819fd74d66706ffb607deb44884401b7 2016-07-25T09:33:25Z 2016-07-25T17:57:31Z Partially revert 44c7de3: fix items text width offset calculation Quentin Rameau quinq@fifth.space commit 657122f7819fd74d66706ffb607deb44884401b7 parent 3c91eed0fb74657c3fa25bc4fd65cd0aa88464c0 Author: Quentin Rameau <quinq@fifth.space> Date: Mon, 25 Jul 2016 11:33:25 +0200 Partially revert 44c7de3: fix items text width offset calculation Without this, we discard the item if it's longer than assigned width instead of truncating it. 3c91eed0fb74657c3fa25bc4fd65cd0aa88464c0 2016-06-28T15:56:25Z 2016-06-28T15:56:25Z config.def.h: style improvement, use color Scheme enum Hiltjo Posthuma hiltjo@codemadness.org commit 3c91eed0fb74657c3fa25bc4fd65cd0aa88464c0 parent 76eb5783046cf89ba6b7e9f8cdab35fe86d07a82 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 28 Jun 2016 17:56:25 +0200 config.def.h: style improvement, use color Scheme enum 76eb5783046cf89ba6b7e9f8cdab35fe86d07a82 2016-06-28T05:11:50Z 2016-06-28T15:51:28Z fix: Do not crash on e.g. dmenu < /dev/null S. Gilles sgilles@math.umd.edu commit 76eb5783046cf89ba6b7e9f8cdab35fe86d07a82 parent 44c7de3dcf49ee568863f55610f40c7a05b4dfe7 Author: S. Gilles <sgilles@math.umd.edu> Date: Tue, 28 Jun 2016 01:11:50 -0400 fix: Do not crash on e.g. dmenu < /dev/null 44c7de3dcf49ee568863f55610f40c7a05b4dfe7 2016-05-21T19:51:14Z 2016-06-03T17:13:15Z import new drw from libsl and minor fixes. Markus Teich markus.teich@stusta.mhn.de commit 44c7de3dcf49ee568863f55610f40c7a05b4dfe7 parent b3d9451c2ddfad7c1b10e9a868afed4d92b37e41 Author: Markus Teich <markus.teich@stusta.mhn.de> Date: Sat, 21 May 2016 21:51:14 +0200 import new drw from libsl and minor fixes. - extract drawitem function (code deduplication) - fix bug where inputw was not correctly calculated from the widest item, but just from the one with the longest strlen() which is not the same. It's better now, but does not account for fallback fonts, since it would be too slow to calculate all the correct item widths on startup. - minor code style fixes (indentation, useless line breaks) b3d9451c2ddfad7c1b10e9a868afed4d92b37e41 2016-02-22T14:03:36Z 2016-02-22T23:31:03Z arg.h: fixed argv checks order Lucas Gabriel Vuotto l.vuotto92@gmail.com commit b3d9451c2ddfad7c1b10e9a868afed4d92b37e41 parent 3de85ca21cedf2a9f67755afc8ef031a9170b96a Author: Lucas Gabriel Vuotto <l.vuotto92@gmail.com> Date: Mon, 22 Feb 2016 11:03:36 -0300 arg.h: fixed argv checks order This prevents accessing to a potentially out-of-bounds memory section. Signed-off-by: Lucas Gabriel Vuotto <l.vuotto92@gmail.com> 3de85ca21cedf2a9f67755afc8ef031a9170b96a 2016-01-11T12:26:37Z 2016-01-14T22:02:27Z Typofix Klemens Nanni kl3@posteo.org commit 3de85ca21cedf2a9f67755afc8ef031a9170b96a parent bf3deb6357f1c864ba6b9771a33dc31e18a68e16 Author: Klemens Nanni <kl3@posteo.org> Date: Mon, 11 Jan 2016 13:26:37 +0100 Typofix bf3deb6357f1c864ba6b9771a33dc31e18a68e16 2015-12-19T18:58:03Z 2015-12-19T19:32:17Z Shut up glibc about _BSD_SOURCE being deprecated Quentin Rameau quinq@fifth.space commit bf3deb6357f1c864ba6b9771a33dc31e18a68e16 parent 120e8401074254d39be916ad83bafda9ef25e6a9 Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 19 Dec 2015 19:58:03 +0100 Shut up glibc about _BSD_SOURCE being deprecated 120e8401074254d39be916ad83bafda9ef25e6a9 2015-12-19T08:32:55Z 2015-12-19T19:32:14Z Add config option for word delimiters Quentin Rameau quinq@fifth.space commit 120e8401074254d39be916ad83bafda9ef25e6a9 parent 32f2564dbbbf5aeafb7190a3d35066142f34448f Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 19 Dec 2015 09:32:55 +0100 Add config option for word delimiters Let the user configure word boundaries other than ' ', only works with the portable character set. 32f2564dbbbf5aeafb7190a3d35066142f34448f 2015-11-08T22:37:47Z 2015-11-08T22:37:47Z arg.h: remove unused ARGNUM* macros Hiltjo Posthuma hiltjo@codemadness.org commit 32f2564dbbbf5aeafb7190a3d35066142f34448f parent cc596365ac9c522beb8978cfca741d23d3bf83ae Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 8 Nov 2015 23:37:47 +0100 arg.h: remove unused ARGNUM* macros