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.
This ensures the surface has been mapped, and our “current” output is
known.
This fixes an issue where modules depending on the current output
being known failed to update correctly during startup.
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);
^
If the module is empty (width is 0) no spacing will be rendered for it.
This makes modules that auto-hide (for example, network modules for interfaces not used all of the time) occupy no space in the bar.
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>
If the user did *not* configured a specific monitor, we prefer the
primary monitor. However, if that monitor is disconnected, yambar
would exit with:
no matching monitor
This patch changes this, to use the *last* connected monitor. It also
improves the error message.
Note: if the user did specify a monitor in the configuration, but
perhaps misspelled it, we will *not* fallback to another monitor, but
instead log an error saying that specific monitor could not be found.
The ‘river’ module depends on generated protocol sources. These are
normally provided, indirectly, by the Wayland bar backend. But when
building plugins as shared modules, the plugins no longer depend on
the bar, and thus ‘river’ fails to build.
Fix this by doing two things:
* **Remove** the ‘river’ protocol from the ‘generic’ Wayland protocols
* Explicitly add both the generic and the ‘river’ specific protocols
to the ‘river’ module.
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.