We add a dirty flag on the menu to track if the menu actually need a
redraw. With it, we will not redraw if the touch is hold on the same
entry by example.
This also adds scdoc as a dependency.
scdoc is almost as easy as markdown and therefore it's much nicer to
write and maintain manpages making use of it instead of plain roff.
It works on Wayland and X11 and acts as a complement to margin. Exact
behavior is as follows:
- If width factor is 0, width minus margin is used.
- If width multiplied by factor is greater than width minus margin,
width minus is used. (so margin may be used to make sure that bemenu
is at least N pixels away from the view border)
- Otherwise width multiplied by factor is used.
I think it's fine to disable warnings about floating point numbers
comparision. We don't do any arithmetics on them anyway, so we can't
suffer from inaccuracy.
`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:
lib/renderers/curses/curses.c:234:9:
error: format not a string literal and no format arguments [-Werror=format-security]
234 | mvprintw(0, 0, menu->title);
| ^~~~~~~~
Let's wrap all the missing places with "%s" format.
This caused issue when using the -b (bottom) and -l (line) arguments on
scaled outputs.
When using a scaled output, the set_size use a wrong value as height.
We generated a scalled buffer so we used a scale x too high size.
We just have to divide the scaling to use a good size.
On most systems it's fairly uncommon to have hidden files within
`$PATH`, but in case of NixOS this is fairly regularly the case as we
have the convention to add `foo` and `.foo-wrapped` to a `bin`-directory
if `foo` is supposed to be a wrapper which sets e.g. env-vars for the
program.
These `.foo-wrapped`-executables are almost never needed, but are shown
in `bemenu` right at the start, so I modified the selection code to skip
hidden files which is also what `dmenu` does for instance.
This seems to be broken at least on some terminals and the high bit
toggle corrupts input. In addition there was printf for the esc/alt key
detection that can break the UI.
Neovim seems to have noncompatible way of detecting alt, so I think
neovim should be looked for proper way for handling this.
Previously, any seat without a keyboard could destroy our selected
keyboard. Now, select by seat instead and only destroy the keyboard if
it vanishes from that seat. This isn't actually multi-seat support, but
at least it will allow bemenu to accept input.