If the amount of data coming in is more than we can hold in our
buffer, we resized the buffer by doubling its size. However, there
were two(!) issues here:
* If this was the first resize, the buffer size was set to 1024. This
may not be enough (i.e. there may be more than 1024 bytes to process).
* In all other cases, the buffer size was doubled. However, there is
still no guarantee the buffer is large enough.
Fix by looping until the buffer *is* large enough.
This ensures the bar's size (width) is updated when the screen
resolution (and/or scale) is changed.
Note that we already handled scale changes. This logic has been moved
from output_scale() to output_done().
Closes#330
If the surface enters an output, there's no need for
last_mapped_monitor, and it must be reset to fulfill the asserts in
other parts of the code.
This makes yambar no longer crash when it is hidden by an opaque window
multiple times on a compositor using wlroots' scene tree.
MFD_NOEXEC_SEAL is only supported on kernels 6.3 and later.
If we were compiled on linux >= 6.3, but run on linux < 6.3, we'd exit
with an error, due to memfd_create() failing with EINVAL.
This patch fixes the problem by first trying to call
memfd_create() *with* MFD_NOEXEC_SEAL, and if that fails with EINVAL,
we try again without it.
Flex regexps are greedy.
This means '"foo" || "bar"' will return 'foo" || "bar', which is
obviously wrong.
Use "start conditions" to implement non-greedy matching.
Closes#302
Fixes the following compiler warning/error:
In file included from /usr/include/stdio.h:906,
from ../tag.c:6:
In function ‘snprintf’,
inlined from ‘tags_expand_template’ at ../tag.c:708:13:
/usr/include/bits/stdio2.h:54:10: error: ‘fmt’ may be used uninitialized [-Werror=maybe-uninitialized]
54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
../tag.c: In function ‘tags_expand_template’:
../tag.c:677:25: note: ‘fmt’ was declared here
677 | const char *fmt;
| ^~~
cc1: all warnings being treated as errors
Closes#311
We now do tilde expansion of the *first* argument in on-click
handlers.
That is:
~/bin/foobar.sh ~/arg1
is expanded to
$HOME/bin/foobar.sh ~/arg1
(meaning, the handler will most likely *not* do what you’d expect)
Related to #307