set preferred scale on creation (LayerShell)

This commit is contained in:
Leonardo Hernández Hernández 2024-06-05 00:42:43 -06:00
parent 13925eb1da
commit 46ae075430
No known key found for this signature in database
GPG key ID: E538897EE11B9624

3
dwl.c
View file

@ -71,6 +71,7 @@
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define ROUND(X) ((int)((X < 0) ? (X - 0.5) : (X + 0.5)))
#define CEIL(X) ((int)((X < 0) ? (X) : ((int)X == X) ? (X) : ((int)X + 1)))
#define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS)
#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
#define LENGTH(X) (sizeof X / sizeof X[0])
@ -884,6 +885,8 @@ createlayersurface(struct wl_listener *listener, void *data)
wl_list_insert(&l->mon->layers[layer_surface->pending.layer],&l->link);
wlr_surface_send_enter(surface, layer_surface->output);
wlr_fractional_scale_v1_notify_scale(surface, l->mon->wlr_output->scale);
wlr_surface_set_preferred_buffer_scale(surface, CEIL(l->mon->wlr_output->scale));
/* Temporarily set the layer's current state to pending
* so that we can easily arrange it