fix: Incorrect layer margin init

This commit is contained in:
DreamMaoMao 2025-07-03 10:30:20 +08:00
parent 656b6d12f4
commit 7c175051b7

View file

@ -3234,7 +3234,7 @@ void get_layer_target_geometry(LayerSurface *l, struct wlr_box *target_box) {
if (box.width == 0) {
box.x += state->margin.left;
box.width = bounds.width - (state->margin.left + state->margin.right);
} else if (!(state->anchor & both_horiz)) {
} else {
if (state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) {
box.x += state->margin.left;
} else if (state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT) {
@ -3245,7 +3245,7 @@ void get_layer_target_geometry(LayerSurface *l, struct wlr_box *target_box) {
if (box.height == 0) {
box.y += state->margin.top;
box.height = bounds.height - (state->margin.top + state->margin.bottom);
} else if (!(state->anchor & both_vert)) {
} else {
if (state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) {
box.y += state->margin.top;
} else if (state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM) {