dmenu, branch HEADdynamic menu
8b48986f4c730725367e2865e5ea24931855018f2025-09-29T16:47:16Z2025-09-29T16:47:16Zdrw.c: drw_scm_free: call free insideHiltjo Posthumahiltjo@codemadness.orgcommit 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.
77f96d704bd16b04fe731da815a4e76c4e62decb2025-09-27T10:10:37Z2025-09-27T10:10:37Zcleanup schemes and colorsHiltjo Posthumahiltjo@codemadness.orgcommit 77f96d704bd16b04fe731da815a4e76c4e62decb
parent d893c63cdd927c33b9b8c9bc52aaa284199a650a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 27 Sep 2025 12:10:37 +0200
cleanup schemes and colors
d893c63cdd927c33b9b8c9bc52aaa284199a650a2025-08-09T12:33:40Z2025-08-09T12:33:40Zbump version to 5.4Hiltjo Posthumahiltjo@codemadness.orgcommit d893c63cdd927c33b9b8c9bc52aaa284199a650a
parent b1e217b29aab8936e9831961943676acd9cdcdd8
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 9 Aug 2025 14:33:40 +0200
bump version to 5.4
b1e217b29aab8936e9831961943676acd9cdcdd82025-03-15T18:53:56Z2025-03-17T20:01:05ZXUngrabKeyboard() instead of XUngrabKey()Adam Purkrtadam@purkrt.czcommit 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.
86f0b5119eaa39943013d009967432ffd9d183652024-10-30T12:03:25Z2024-10-30T12:03:25Zremove extra newlineHiltjo Posthumahiltjo@codemadness.orgcommit 86f0b5119eaa39943013d009967432ffd9d18365
parent dd3d348ae86065edf2d1e2a1bc920685dc4982fc
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 30 Oct 2024 13:03:25 +0100
remove extra newline
dd3d348ae86065edf2d1e2a1bc920685dc4982fc2024-10-30T12:02:57Z2024-10-30T12:02:57ZAvoid unsigned integer underflow in drw_text()Hiltjo Posthumahiltjo@codemadness.orgcommit 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.
545031a076d4b5712442a8fc2d983f1e9d9f4f792024-10-27T19:08:46Z2024-10-27T19:08:46Zutil.c: output function might override errno and thus affect perror()Hiltjo Posthumahiltjo@codemadness.orgcommit 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!
475d8093cb8d29d5756937bfa9e0b3b9e415f6322024-07-14T09:40:20Z2024-07-14T09:43:01Zdrw.c: use the same pattern as ellipsis_width to check for infinite recursionHiltjo Posthumahiltjo@codemadness.orgcommit 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
59936c7d972587a47d61161279bb8e8abc0b02f32024-07-04T21:27:47Z2024-07-14T09:42:58Zrender invalid utf8 sequences as U+FFFDNRKnrk@disroot.orgcommit 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
51e32d49b56c86cd288c64fccf6cd765547781b92024-07-04T21:25:37Z2024-07-14T09:42:55Zoverhaul utf8decode()NRKnrk@disroot.orgcommit 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.
7be720cc88ed2294338f7182600df10f21c575ce2024-03-19T11:12:52Z2024-03-19T11:12:52Zbump version to 5.3Hiltjo Posthumahiltjo@codemadness.orgcommit 7be720cc88ed2294338f7182600df10f21c575ce
parent 8df553e0048733bab4bc85a6b76bcfd44c046e71
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 19 Mar 2024 12:12:52 +0100
bump version to 5.3
8df553e0048733bab4bc85a6b76bcfd44c046e712023-09-22T13:16:44Z2023-09-22T13:16:44ZMakefile: remove the options targetHiltjo Posthumahiltjo@codemadness.orgcommit 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.
7ab0cb5ef0e19352fc5d64ae0d57a5cf4540acbf2023-07-07T11:00:42Z2023-07-07T13:03:57Zdrw: minor improvement to the nomatches cacheNRKnrk@disroot.orgcommit 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.
0fe460dbd469a1d5b6a7140d0e1801935e4a923b2023-04-05T20:11:49Z2023-04-06T18:28:56Zfix BadMatch error when embedding on some windowsLucas de Senalucas@seninha.orgcommit 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
dfbbf7f6e1b22ccf9e5a45d77ee10995577fb4fc2023-03-08T20:20:52Z2023-03-08T20:28:51Zreadstdin: reduce memory-usage by duplicating the line from getline()Hiltjo Posthumahiltjo@codemadness.orgcommit 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.
ba1a347dcaba055f824161007dfee60db3ea785b2022-10-31T10:52:30Z2022-10-31T10:52:30Zreadstdin: allocate amount of itemsHiltjo Posthumahiltjo@codemadness.orgcommit 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)).
bcbc1ef5c4cf4875a4d66e7dc0919da88a6096a52022-10-31T10:43:34Z2022-10-31T10:46:10Zreadstdin: add a commentHiltjo Posthumahiltjo@codemadness.orgcommit 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.
689d9bfcf6859e5ce85c296ff0f23b5c08b1fedc2022-10-30T18:10:45Z2022-10-31T10:40:35Zfix leak when getline failsNRKnrk@disroot.orgcommit 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.
e42c03663442f5fb2f66dd59cc5bfdc61c53192c2022-10-26T07:43:17Z2022-10-26T07:43:17Zdmenu: small XmbLookupString code improvementsHiltjo Posthumahiltjo@codemadness.orgcommit 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.
1d2b462acf1210b8f86966b8dd9bb6e36e369ee12022-10-04T17:36:02Z2022-10-04T17:36:02Zbump version to 5.2Hiltjo Posthumahiltjo@codemadness.orgcommit 1d2b462acf1210b8f86966b8dd9bb6e36e369ee1
parent 7ec32fe4944d4f7137cf2a23366324ffe0f10a70
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 4 Oct 2022 19:36:02 +0200
bump version to 5.2
7ec32fe4944d4f7137cf2a23366324ffe0f10a702022-09-26T09:24:15Z2022-10-01T11:20:40Zdmenu: use die() to print the usage messageTom Schwindlschwindl@posteo.decommit 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
fce06f437dcec646ee0a2728fe695f3084cc6ccb2022-09-16T21:05:07Z2022-09-17T13:32:26Zremove workaround for a crash with color emojis on some systems, now fixed in libXft 2.3.5Hiltjo Posthumahiltjo@codemadness.orgcommit 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
1e8c5b68f4881bd4ae257c780fd41f129c79f4192022-09-02T17:09:50Z2022-09-02T17:09:50Zfix a regression in the previous commit for tab completeHiltjo Posthumahiltjo@codemadness.orgcommit 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!
528d39b011afb7ef6fd794ba6b74155d4e69bc682022-09-01T17:51:43Z2022-09-02T11:00:48Ztab-complete: figure out the size before copyingNRKnrk@disroot.orgcommit 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).
32db2b125190d366be472ccb7cad8332486961442022-09-01T18:35:18Z2022-09-02T10:53:34Zreadstdin: use getline(3)NRKnrk@disroot.orgcommit 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.
e35976f4a50f884c2162f71e4128d7c273e3e0422022-08-08T08:42:54Z2022-08-08T08:42:54Zsync code-style patch from libslHiltjo Posthumahiltjo@codemadness.orgcommit e35976f4a50f884c2162f71e4128d7c273e3e042
parent 28fb3e28120db29ea45d1951eee7047b4109ab5f
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 8 Aug 2022 10:42:54 +0200
sync code-style patch from libsl
28fb3e28120db29ea45d1951eee7047b4109ab5f2022-05-01T16:38:25Z2022-05-01T16:38:25ZMakefile: add manual path for OpenBSDHiltjo Posthumahiltjo@codemadness.orgcommit 28fb3e28120db29ea45d1951eee7047b4109ab5f
parent fe5d5c6709a77ac5d554e26dda76a67df68618ae
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 1 May 2022 18:38:25 +0200
Makefile: add manual path for OpenBSD
fe5d5c6709a77ac5d554e26dda76a67df68618ae2022-04-30T11:19:33Z2022-04-30T11:19:33Zfix incorrect comment, math is hardHiltjo Posthumahiltjo@codemadness.orgcommit fe5d5c6709a77ac5d554e26dda76a67df68618ae
parent e1e1de7b3b8399cba90ddca9613f837b2dbef7b9
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 30 Apr 2022 13:19:33 +0200
fix incorrect comment, math is hard
e1e1de7b3b8399cba90ddca9613f837b2dbef7b92022-04-29T18:15:48Z2022-04-29T18:18:02Zinputw: improve correctness and startup performance, by NRKHiltjo Posthumahiltjo@codemadness.orgcommit 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).
33685b06e9332638769e677e77b257e24e069fd12022-03-28T15:38:49Z2022-04-16T14:21:01Zdrw_text: account for fallback fonts in ellipsis_widthNRKnrk@disroot.orgcommit 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.
e4827b0c4048718ab06670cf60ef68d028fe7fc42022-03-27T19:02:52Z2022-04-16T14:21:01Zdrw_text: don't segfault when called with 0 widthNRKnrk@disroot.orgcommit 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>
e73651f12a406629778f02d8e5acbe2caec0dfc22022-03-26T16:58:47Z2022-03-26T16:58:47Zfix UB with the function iscntrl()Hiltjo Posthumahiltjo@codemadness.orgcommit 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
31fa07b9849b0ffbf4b7efb55943f466b3ff160f2022-03-26T16:57:50Z2022-03-26T16:57:50ZRevert "avoid redraw when there's no change"Hiltjo Posthumahiltjo@codemadness.orgcommit 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
6818e07291f3b2913e687c8ec3d3fe47117240502022-03-25T21:51:45Z2022-03-25T21:53:50Zavoid redraw when there's no changeNRKnrk@disroot.orgcommit 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.
b43ec0577f2ad8ad33a0b893fe5360d9660367862022-03-25T21:51:09Z2022-03-25T21:53:50Zfree all allocated items, use %zu for size_tNRKnrk@disroot.orgcommit 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.
22511c41d55a38a770541ae617a09383d5e6ad1c2022-03-23T18:37:55Z2022-03-25T21:49:07Zdrw_text: improve performance when there's no matchNRKnrk@disroot.orgcommit 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
77526f756e23e362081ac807521f901f2e5cd5e62022-03-23T18:37:55Z2022-03-25T21:49:07Zinputw: improve correctness and startup performanceNRKnrk@disroot.orgcommit 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.
7269c5355d257dd2ad2c53f15dc9c1cf6796aea52022-03-23T20:04:04Z2022-03-25T21:49:07Zsignificantly improve performance on large stringsNRKnrk@disroot.orgcommit 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.
6be057f060543bb0f3ed9423904263617cdffffe2022-03-23T20:00:00Z2022-03-25T21:49:07Zintroduce drw_fontset_getwidth_clamp()NRKnrk@disroot.orgcommit 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().
41fdabbf7c517f8d524b70cbd78238cc319ccef32022-03-23T18:37:55Z2022-03-25T21:49:07Zdrw_text: improve both performance and correctnessNRKnrk@disroot.orgcommit 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.
3a505cebe8adab204e5619357e0bfe3f9f3a92ff2022-03-01T21:45:39Z2022-03-01T21:45:39Zremove false-positive warning for int comparison as boolHiltjo Posthumahiltjo@codemadness.orgcommit 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!
308fe78b83836371720c7d7eb2c3eac409f3cc162022-02-11T11:26:35Z2022-02-11T11:26:35Zbump version to 5.1Hiltjo Posthumahiltjo@codemadness.orgcommit 308fe78b83836371720c7d7eb2c3eac409f3cc16
parent c4b656e0da36070a834b03ceb76269ffee8ac952
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 11 Feb 2022 12:26:35 +0100
bump version to 5.1
c4b656e0da36070a834b03ceb76269ffee8ac9522022-02-08T20:45:28Z2022-02-08T20:45:28Zcode-style: rm newline (oops)Hiltjo Posthumahiltjo@codemadness.orgcommit c4b656e0da36070a834b03ceb76269ffee8ac952
parent 3e39c526d28582b0b5606d3e3bb36ee3d271e616
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 8 Feb 2022 21:45:28 +0100
code-style: rm newline (oops)
3e39c526d28582b0b5606d3e3bb36ee3d271e6162022-02-08T18:32:25Z2022-02-08T18:38:23Zrevert using strcasestr and use a more optimized portable versionHiltjo Posthumahiltjo@codemadness.orgcommit 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!
a9a3836861bd23387b5a51d6f6ac23377e98e26f2022-02-07T09:36:13Z2022-02-07T09:36:13Zfollow-up fix: add -D_GNU_SOURCE for strcasestr for some systemsHiltjo Posthumahiltjo@codemadness.orgcommit 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
eb96af27f4059c93d7e000e910b71d74829a239b2022-02-06T23:21:12Z2022-02-06T23:21:12Zimprove performance of case-insensitive matchingHiltjo Posthumahiltjo@codemadness.orgcommit eb96af27f4059c93d7e000e910b71d74829a239b
parent d78ff08d99780a73447d5a95bf1e358e8c23aa3c
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 7 Feb 2022 00:21:12 +0100
improve performance of case-insensitive matching
d78ff08d99780a73447d5a95bf1e358e8c23aa3c2021-08-20T21:05:53Z2021-08-20T21:05:53ZRevert "Improve speed of drw_text when provided with large strings"Hiltjo Posthumahiltjo@codemadness.orgcommit 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.
cd2133a5f66b42f992a9a1b92bbbce11dc26b9412021-08-09T16:39:25Z2021-08-09T16:39:25Zadd support for more keypad keysHiltjo Posthumahiltjo@codemadness.orgcommit 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.
c585e8e498ec6f9c423ab8ea07cf853ee5b05fbe2021-08-08T01:34:35Z2021-08-09T16:20:51ZImprove speed of drw_text when provided with large stringsMiles Alanm@milesalan.comcommit 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.
523aa08f51a88c59ad4b1f600f8ce3d122e9e2892021-07-25T01:55:25Z2021-07-25T08:55:45Zremove always true condition in if statementGuilherme Janczakguilherme.janczak@yandex.comcommit 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
1a13d0465d1a6f4f74bc5b07b04c9bd542f20ba62020-09-02T16:30:56Z2020-09-02T16:31:23Zbump version to 5.0Hiltjo Posthumahiltjo@codemadness.orgcommit 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.
9b38fda6feda68f95754d5b8932b1a69471df9602020-06-11T16:45:33Z2020-06-11T16:45:33ZFix memory leaks in drwHiltjo Posthumahiltjo@codemadness.orgcommit 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.
db6093f6ec1bb884f7540f2512935b5254750b302019-03-03T12:08:54Z2019-03-03T12:08:54Zrevert IME supportHiltjo Posthumahiltjo@codemadness.orgcommit 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.
a9b1de384ae1ad30805e893af5cd6ea9b87c89da2019-02-12T21:58:35Z2019-02-12T21:58:35Zimprove xopenim error messageHiltjo Posthumahiltjo@codemadness.orgcommit 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.
43b0c2c3dd3e694cf674097d493ef6630efc54032019-02-12T21:13:58Z2019-02-12T21:13:58Zmake dmenu_path script executableHiltjo Posthumahiltjo@codemadness.orgcommit 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)
f5036b90efd9423d805923a0bc73cd54e30e72ab2019-02-12T18:10:43Z2019-02-12T18:10:43Zfix crash when XOpenIM returns NULLHiltjo Posthumahiltjo@codemadness.orgcommit 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).
153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab52019-02-03T23:29:26Z2019-02-04T18:49:34ZClose when the embedding window is destroyedQuentin Rameauquinq@fifth.spacecommit 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
65be875f5adf31e9c4762ac8a8d74b1dfdd785842019-02-02T12:54:15Z2019-02-02T12:54:15ZPrepared 4.9 release.Anselm R Garbeanselm@garbe.cacommit 65be875f5adf31e9c4762ac8a8d74b1dfdd78584
parent 7d19b2055d98e5c0249efe582c852b8b8b30cd41
Author: Anselm R Garbe <anselm@garbe.ca>
Date: Sat, 2 Feb 2019 04:54:15 -0800
Prepared 4.9 release.
7d19b2055d98e5c0249efe582c852b8b8b30cd412019-01-27T14:28:02Z2019-01-27T14:28:02Zdmenu.1: document improved fastgrab behaviour from previous patchHiltjo Posthumahiltjo@codemadness.orgcommit 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
11a65377da8fc198d15cf041dbbbb9718e5798cd2019-01-26T14:49:15Z2019-01-27T14:26:04ZUse slow path if stdin is a ttydokdok@grehack.frcommit 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.
bbc464dc80225b8cf9390f14fac6c682f63940d22018-07-21T10:47:43Z2018-07-21T10:49:00Zdmenu_path: always use the cachedirQuentin Rameauquinq@fifth.spacecommit bbc464dc80225b8cf9390f14fac6c682f63940d2
parent a314412f4b80af5100901344856a341f8ea4cc7a
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 21 Jul 2018 12:47:43 +0200
dmenu_path: always use the cachedir
a314412f4b80af5100901344856a341f8ea4cc7a2018-06-02T15:09:01Z2018-06-02T15:09:01ZMakefile: just show the compiler outputHiltjo Posthumahiltjo@codemadness.orgcommit 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.
a9eae39e934d8dab7f1772570efb5f25825bfe012018-06-02T15:01:24Z2018-06-02T15:01:24ZDo not strip at link stageHiltjo Posthumahiltjo@codemadness.orgcommit 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.
851b73d178c8d7665c6d8a0bc34dbd4f9d1aa77b2018-05-25T11:07:17Z2018-05-25T11:07:17Zcode-style for pledge: check the return code -1, not < 0Hiltjo Posthumahiltjo@codemadness.orgcommit 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
05c138f5b8f19070a190b97728c83b454855f52b2018-05-25T11:03:25Z2018-05-25T11:03:25Zcode-style for pledge(2)Hiltjo Posthumahiltjo@codemadness.orgcommit 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
cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c2018-05-25T10:04:22Z2018-05-25T10:04:22ZPledge on OpenBSDHiltjo Posthumahiltjo@codemadness.orgcommit cd132c8d5b17ac2f4a3e611836d4cde4995d7a0c
parent e75494b730ea6883e68072a106a09a301cfaf845
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 25 May 2018 12:04:22 +0200
Pledge on OpenBSD
e75494b730ea6883e68072a106a09a301cfaf8452018-05-09T19:27:29Z2018-05-12T17:12:25ZUse bold for keyboard shortcuts in dmenu.1David Demeliermarkand@malikania.frcommit 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.
0f76dd2fb89748eb5460adbc87c4e98bcce097632018-04-22T12:18:34Z2018-04-22T12:19:20ZFix cursor drawn position with wide glyphsQuentin Rameauquinq@fifth.spacecommit 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
0b5748021877b2f214474b034d8bf0122ee88ed22018-03-22T10:18:56Z2018-04-22T12:09:05ZMakefile: bikesheddingly replace ${} with $()Quentin Rameauquinq@fifth.spacecommit 0b5748021877b2f214474b034d8bf0122ee88ed2
parent 377bd37e212b1ec4c03a481245603c6560d0be22
Author: Quentin Rameau <quinq@fifth.space>
Date: Thu, 22 Mar 2018 11:18:56 +0100
Makefile: bikesheddingly replace ${} with $()
377bd37e212b1ec4c03a481245603c6560d0be222018-03-19T14:42:28Z2018-04-22T12:09:05ZHandle IME inputQuentin Rameauquinq@fifth.spacecommit 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!
b6d2cc9aea979cb3557db39dbe65a2870d13e5972018-03-16T15:51:22Z2018-04-22T12:09:05ZFix handling of input stringsHiltjo Posthumahiltjo@codemadness.orgcommit b6d2cc9aea979cb3557db39dbe65a2870d13e597
parent 2f398981feb562285b0a96cd315bf2b3244c7309
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 16 Mar 2018 16:51:22 +0100
Fix handling of input strings
2f398981feb562285b0a96cd315bf2b3244c73092018-03-15T09:16:10Z2018-03-15T17:29:32ZUpdate LICENSEQuentin Rameauquinq@fifth.spacecommit 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.
23051d78dd80468042e2a5095533ec68bfb43a512018-03-14T18:48:05Z2018-03-14T18:48:05Zbump version to 4.8Hiltjo Posthumahiltjo@codemadness.orgcommit 23051d78dd80468042e2a5095533ec68bfb43a51
parent e2a280541eab62717d6a9a72d047c832e5cb1edc
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 14 Mar 2018 19:48:05 +0100
bump version to 4.8
e2a280541eab62717d6a9a72d047c832e5cb1edc2018-03-13T16:15:09Z2018-03-13T19:10:46Zadd key bindings for moving to the word start or endQuentin Rameauquinq@fifth.spacecommit 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
889512811d7ae410eb4ab60be3568278b3e23f2e2018-01-04T22:45:49Z2018-01-04T22:45:49ZFix regression in 84a1bc5Hiltjo Posthumahiltjo@codemadness.orgcommit 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).
84a1bc5d0d6b54eb23268e8f02a787be9ccbd9192018-01-04T12:27:37Z2018-01-04T17:14:41ZInstantiate j var outside #ifdef XINEMARA directive because it is used in loop outside directiveVincent Carluervince@bitfu.iocommit 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
f0a5b75d6a0d2a62da45e9f65d92ea4a6a2d58312017-11-03T20:10:38Z2017-11-03T20:10:38Zdrw: drw_scm_create: use Clr typeHiltjo Posthumahiltjo@codemadness.orgcommit 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.
1cabeda5505dcc35d4d2ca2a09151a7c449fb4012017-11-03T14:31:37Z2017-11-03T20:07:02Zfix a possible free of a uninitialize variable in paste()Hiltjo Posthumahiltjo@codemadness.orgcommit 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()
41379f7c39e6aa0a17d7807b22b49ea148f5b0fa2017-11-03T20:05:29Z2017-11-03T20:05:29Zinit colors using SchemeLastHiltjo Posthumahiltjo@codemadness.orgcommit 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.
64ab2801fbbbcc028c359080ae4bd546fc871f672017-11-03T16:49:10Z2017-11-03T19:41:03ZSet class name on menu windowOmar Sandovalosandov@osandov.comcommit 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.
f428f3e01a4ced5b1df07ddf913bb022692f80352017-05-02T16:32:04Z2017-05-02T16:32:04Zrelease 4.7Hiltjo Posthumahiltjo@codemadness.orgcommit f428f3e01a4ced5b1df07ddf913bb022692f8035
parent 5cd66e2c6ca6a82e59927d495498fa6e478594d6
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 2 May 2017 18:32:04 +0200
release 4.7
5cd66e2c6ca6a82e59927d495498fa6e478594d62016-12-07T14:45:01Z2016-12-11T11:33:16ZRevert "fix input text matching"Andrew Gregoryandrew.gregory.8@gmail.comcommit 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.
e90b88e12a88d6214c00d5ee58ceb69446aa5ac42016-11-25T12:38:09Z2016-11-25T13:21:40ZXinerama: correct variable declarations in preprocessor conditionalThomas Gardnertmg@fastmail.comcommit 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
a280bdad1f16943a70eaff086852d3b11043b0602016-11-05T10:36:42Z2016-11-05T10:36:42Zdie() on calloc failureHiltjo Posthumahiltjo@codemadness.orgcommit 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!
a9a5c6cc2d7d55ed7e556a4fe9d75307c6df2e842016-10-08T12:08:28Z2016-10-14T13:26:35Zadd embedding support with -w optionQuentin Rameauquinq@fifth.spacecommit a9a5c6cc2d7d55ed7e556a4fe9d75307c6df2e84
parent a97f550aa7b81d2add1d2a99e594c038da01fc19
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 8 Oct 2016 14:08:28 +0200
add embedding support with -w option
a97f550aa7b81d2add1d2a99e594c038da01fc192016-10-08T12:42:53Z2016-10-14T13:26:34Zdmenu.1: group single optionsQuentin Rameauquinq@fifth.spacecommit a97f550aa7b81d2add1d2a99e594c038da01fc19
parent ff8daf88475960f6ccc4e3ded3214147ecb21809
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 8 Oct 2016 14:42:53 +0200
dmenu.1: group single options
ff8daf88475960f6ccc4e3ded3214147ecb218092016-10-08T12:36:04Z2016-10-14T13:26:34Zdmenu.1: fix -l optionQuentin Rameauquinq@fifth.spacecommit ff8daf88475960f6ccc4e3ded3214147ecb21809
parent 026827fd65c1163a92a984c4eae3882a6d69f8df
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 8 Oct 2016 14:36:04 +0200
dmenu.1: fix -l option
026827fd65c1163a92a984c4eae3882a6d69f8df2016-08-12T12:39:30Z2016-08-12T12:39:30Zdie() consistency: always add newlineHiltjo Posthumahiltjo@codemadness.orgcommit 026827fd65c1163a92a984c4eae3882a6d69f8df
parent d14670b9959f8b3760b63dd40a70687a90312b8a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 12 Aug 2016 14:39:30 +0200
die() consistency: always add newline
d14670b9959f8b3760b63dd40a70687a90312b8a2016-07-26T21:13:06Z2016-07-26T21:13:06Zfix crash if negative monitor (< -1) was passedHiltjo Posthumahiltjo@codemadness.orgcommit 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'
aa92cd68bdff95c181cc854043598e6c6007d45e2016-07-26T21:02:34Z2016-07-26T21:02:34ZRevert "Print highlighted input text only on single match"Hiltjo Posthumahiltjo@codemadness.orgcommit 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*
a4053bc4e403ae57343f43b7e363a0911bba5a3a2016-07-26T10:48:23Z2016-07-26T16:29:42ZPrint highlighted input text only on single matchQuentin Rameauquinq@fifth.spacecommit 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.
657122f7819fd74d66706ffb607deb44884401b72016-07-25T09:33:25Z2016-07-25T17:57:31ZPartially revert 44c7de3: fix items text width offset calculationQuentin Rameauquinq@fifth.spacecommit 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.
3c91eed0fb74657c3fa25bc4fd65cd0aa88464c02016-06-28T15:56:25Z2016-06-28T15:56:25Zconfig.def.h: style improvement, use color Scheme enumHiltjo Posthumahiltjo@codemadness.orgcommit 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
76eb5783046cf89ba6b7e9f8cdab35fe86d07a822016-06-28T05:11:50Z2016-06-28T15:51:28Zfix: Do not crash on e.g. dmenu < /dev/nullS. Gillessgilles@math.umd.educommit 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
44c7de3dcf49ee568863f55610f40c7a05b4dfe72016-05-21T19:51:14Z2016-06-03T17:13:15Zimport new drw from libsl and minor fixes.Markus Teichmarkus.teich@stusta.mhn.decommit 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)
b3d9451c2ddfad7c1b10e9a868afed4d92b37e412016-02-22T14:03:36Z2016-02-22T23:31:03Zarg.h: fixed argv checks orderLucas Gabriel Vuottol.vuotto92@gmail.comcommit 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>
3de85ca21cedf2a9f67755afc8ef031a9170b96a2016-01-11T12:26:37Z2016-01-14T22:02:27ZTypofixKlemens Nannikl3@posteo.orgcommit 3de85ca21cedf2a9f67755afc8ef031a9170b96a
parent bf3deb6357f1c864ba6b9771a33dc31e18a68e16
Author: Klemens Nanni <kl3@posteo.org>
Date: Mon, 11 Jan 2016 13:26:37 +0100
Typofix
bf3deb6357f1c864ba6b9771a33dc31e18a68e162015-12-19T18:58:03Z2015-12-19T19:32:17ZShut up glibc about _BSD_SOURCE being deprecatedQuentin Rameauquinq@fifth.spacecommit 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
120e8401074254d39be916ad83bafda9ef25e6a92015-12-19T08:32:55Z2015-12-19T19:32:14ZAdd config option for word delimitersQuentin Rameauquinq@fifth.spacecommit 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.
32f2564dbbbf5aeafb7190a3d35066142f34448f2015-11-08T22:37:47Z2015-11-08T22:37:47Zarg.h: remove unused ARGNUM* macrosHiltjo Posthumahiltjo@codemadness.orgcommit 32f2564dbbbf5aeafb7190a3d35066142f34448f
parent cc596365ac9c522beb8978cfca741d23d3bf83ae
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 8 Nov 2015 23:37:47 +0100
arg.h: remove unused ARGNUM* macros