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.
If the output we’re mapped on is disabled (or disconnected), the
compositor will unmap us.
Up until now, our response was to simply shutdown.
Now, we destroy the surface, remove all pending rendering buffers, and
all further calls to commit() will return immediately, without doing
anything.
If the user has configured a specific monitor to use, we wait for that
output to come back. When it does, we re-create the layer surface and
then we’re up and running again.
Bars running on the “default” monitor are handled in a similar
way. Since we don’t have an output name from the configuration, we
instead store the name of the output we were mapped on, when we’re
either unmapped from that output, or that output global is destroyed.
As soon as we see that output come back, we re-create the layer
surface.
New FreeBSD versions have memfd_create but other BSDs don't.
bar/wayland.c:774:15: error: implicit declaration of function 'memfd_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pool_fd = memfd_create("yambar-wayland-shm-buffer-pool", MFD_CLOEXEC);
^
bar/wayland.c:774:62: error: use of undeclared identifier 'MFD_CLOEXEC'
pool_fd = memfd_create("yambar-wayland-shm-buffer-pool", MFD_CLOEXEC);
^
This allows you to configure the width of each side of the border
individually. border.width can still be used, and will set all four
borders to the same width.
Closes#77
This is an integer that specifies the amount of scrolling that needs
to be accumulated before a wheel-up/down event is emitted.
A higher value means you need to drag your fingers a longer distance
before the event is emitted.
The default is 30.
One can now bind the left/middle/right mouse buttons to on-click. In
fact, you can have all three buttons bound to different handlers for
the same particle. The new syntax is
on-click:
left: <command>
middle: <command>
right: <command>
Leaving one out is the same thing as not mapping it at
all. Furthermore,
on-click: <command>
is still valid, and is a shorthand for
on-click:
left: <commsnd>
This is done by update_size(). Setting it in xdg_output_handle_done()
causes update_size() to do an early exit, and thus we end up never
actually configuring the surface.
We also never instantiate a pixman image, which led to a hard crash at
startup when the user had configured a specific output to use.
This allows the backend to support multi-seat "properly", by checking
against the correct seat. Before this, when we used a single, global
xcursor value, a seat whose pointer needed to be updated would not be
updated.
Instead, roundtrip once all globals have been handled. This means all
listeners have been registered.
When we detect a specific monitor to map to, and it has a non-default
scale, update the cursor theme (since it depends on the scale).