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
This commit is contained in:
Nirbheek Chauhan 2014-04-09 11:27:52 +05:30 committed by Adel Gadllah
parent a967d479c5
commit 0c0973bbd8

View File

@ -1714,12 +1714,12 @@ reload_window_opacity (MetaWindow *window,
gboolean initial) gboolean initial)
{ {
int requested_value = 0xFF; guint8 opacity = 0xFF;
if (value->type != META_PROP_VALUE_INVALID) 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) \ #define RELOAD_STRING(var_name, propname) \