From 14e0fff19afe245074b3d00279313e1588e86cdd Mon Sep 17 00:00:00 2001 From: Arnaud Vrac Date: Thu, 27 Jul 2023 22:41:21 +0200 Subject: [PATCH] desktop-shell: clamp view alpha correctly Clamping of the alpha value is not done properly since the introduction of the weston_view_set_alpha() helper. Signed-off-by: Arnaud Vrac --- desktop-shell/shell.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 8deac7f9..a7de9e30 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3351,10 +3351,7 @@ surface_opacity_binding(struct weston_pointer *pointer, return; alpha = shsurf->view->alpha - (event->value * step); - if (shsurf->view->alpha > 1.0) - shsurf->view->alpha = 1.0; - if (shsurf->view->alpha < step) - shsurf->view->alpha = step; + alpha = CLIP(alpha, step, 1.0); weston_view_set_alpha(shsurf->view, alpha); }