mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
merge sway master
This commit is contained in:
parent
c37aba2736
commit
7460d9f565
63 changed files with 642 additions and 461 deletions
|
|
@ -51,9 +51,6 @@ static void swaybar_output_free(struct swaybar_output *output) {
|
|||
if (output->surface != NULL) {
|
||||
wl_surface_destroy(output->surface);
|
||||
}
|
||||
if (output->input_region != NULL) {
|
||||
wl_region_destroy(output->input_region);
|
||||
}
|
||||
wl_output_destroy(output->output);
|
||||
destroy_buffer(&output->buffers[0]);
|
||||
destroy_buffer(&output->buffers[1]);
|
||||
|
|
@ -113,10 +110,9 @@ static void add_layer_surface(struct swaybar_output *output) {
|
|||
|
||||
if (overlay) {
|
||||
// Empty input region
|
||||
output->input_region = wl_compositor_create_region(bar->compositor);
|
||||
assert(output->input_region);
|
||||
|
||||
wl_surface_set_input_region(output->surface, output->input_region);
|
||||
struct wl_region *region = wl_compositor_create_region(bar->compositor);
|
||||
wl_surface_set_input_region(output->surface, region);
|
||||
wl_region_destroy(region);
|
||||
}
|
||||
|
||||
zwlr_layer_surface_v1_set_anchor(output->layer_surface, config->position);
|
||||
|
|
|
|||
|
|
@ -831,6 +831,15 @@ void render_frame(struct swaybar_output *output) {
|
|||
wl_surface_damage(output->surface, 0, 0,
|
||||
output->width, output->height);
|
||||
|
||||
uint32_t bg_alpha = ctx.background_color & 0xFF;
|
||||
if (bg_alpha == 0xFF) {
|
||||
struct wl_region *region =
|
||||
wl_compositor_create_region(output->bar->compositor);
|
||||
wl_region_add(region, 0, 0, INT32_MAX, INT32_MAX);
|
||||
wl_surface_set_opaque_region(output->surface, region);
|
||||
wl_region_destroy(region);
|
||||
}
|
||||
|
||||
struct wl_callback *frame_callback = wl_surface_frame(output->surface);
|
||||
wl_callback_add_listener(frame_callback, &output_frame_listener, output);
|
||||
output->frame_scheduled = true;
|
||||
|
|
|
|||
|
|
@ -466,6 +466,11 @@ uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x,
|
|||
sni->target_size = target_size;
|
||||
}
|
||||
|
||||
// Passive
|
||||
if (sni->status && sni->status[0] == 'P') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int icon_size;
|
||||
cairo_surface_t *icon;
|
||||
if (sni->icon) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue