mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-19 19:25:41 +02:00
bar/wayland: shutdown when compositor "closed" our layer surface
This commit is contained in:
parent
860ec01791
commit
0678015eb1
1 changed files with 23 additions and 1 deletions
|
@ -461,8 +461,30 @@ layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface,
|
|||
zwlr_layer_surface_v1_ack_configure(surface, serial);
|
||||
}
|
||||
|
||||
static void
|
||||
layer_surface_closed(void *data, struct zwlr_layer_surface_v1 *surface)
|
||||
{
|
||||
struct wayland_backend *backend = data;
|
||||
|
||||
/*
|
||||
* Called e.g. when an output is disabled. We don't get a
|
||||
* corresponding event if/when that same output re-appears. So,
|
||||
* for now, we simply shut down. In the future, we _could_ maybe
|
||||
* destroy the surface, listen for output events and re-create the
|
||||
* surface if the same output re-appears.
|
||||
*/
|
||||
LOG_WARN("compositor requested surface be closed - shutting down");
|
||||
|
||||
if (write(backend->bar->abort_fd, &(uint64_t){1}, sizeof(uint64_t))
|
||||
!= sizeof(uint64_t))
|
||||
{
|
||||
LOG_ERRNO("failed to signal abort to modules");
|
||||
}
|
||||
}
|
||||
|
||||
static const struct zwlr_layer_surface_v1_listener layer_surface_listener = {
|
||||
.configure = layer_surface_configure,
|
||||
.configure = &layer_surface_configure,
|
||||
.closed = &layer_surface_closed,
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Reference in a new issue