From 92d137c78ac05b565bfa06b5659aea52992e0dd7 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 15 Dec 2021 16:30:32 +0100 Subject: [PATCH] layer-shell: fix type of margins These currently use uint32_t while they are an int32_t in the protocol. --- include/wlr/types/wlr_layer_shell_v1.h | 2 +- types/wlr_layer_shell_v1.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wlr/types/wlr_layer_shell_v1.h b/include/wlr/types/wlr_layer_shell_v1.h index 694fb3b2..79e435a0 100644 --- a/include/wlr/types/wlr_layer_shell_v1.h +++ b/include/wlr/types/wlr_layer_shell_v1.h @@ -58,7 +58,7 @@ struct wlr_layer_surface_v1_state { uint32_t anchor; int32_t exclusive_zone; struct { - uint32_t top, right, bottom, left; + int32_t top, right, bottom, left; } margin; enum zwlr_layer_surface_v1_keyboard_interactivity keyboard_interactive; uint32_t desired_width, desired_height; diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c index 456dbc0e..d7a2123e 100644 --- a/types/wlr_layer_shell_v1.c +++ b/types/wlr_layer_shell_v1.c @@ -168,10 +168,10 @@ static void layer_surface_handle_set_margin( return; } - if (surface->current.margin.top == (uint32_t) top - && surface->current.margin.right == (uint32_t) right - && surface->current.margin.bottom == (uint32_t) bottom - && surface->current.margin.left == (uint32_t) left) { + if (surface->current.margin.top == top + && surface->current.margin.right == right + && surface->current.margin.bottom == bottom + && surface->current.margin.left == left) { surface->pending.committed &= ~WLR_LAYER_SURFACE_V1_STATE_MARGIN; } else { surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_MARGIN;