From ab0bd59f5e1d7462a6efacf1a8ca71425a9d1715 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 9 Apr 2014 11:27:52 +0530 Subject: [PATCH] window-props: _NET_WM_WINDOW_OPACITY range is 0xffffffff to 0 After reading the atom, scale the value from 0xffffffff to 0xff. Not doing so causes Clutter to truncate the opacity value, and only read the last two digits. Hence, 0x7fffffff (50%) becomes 0xff (100%). https://bugzilla.gnome.org/show_bug.cgi?id=727874 --- src/x11/window-props.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x11/window-props.c b/src/x11/window-props.c index 128dfdeb7..404e61b24 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -1594,12 +1594,12 @@ reload_window_opacity (MetaWindow *window, gboolean initial) { - int requested_value = 0xFF; + guint8 opacity = 0xFF; if (value->type != META_PROP_VALUE_INVALID) - requested_value = (int) value->v.cardinal; + opacity = (guint8)((gfloat)value->v.cardinal * 255.0 / ((gfloat)0xffffffff)); - meta_window_set_opacity (window, requested_value); + meta_window_set_opacity (window, opacity); } #define RELOAD_STRING(var_name, propname) \