[mutter] window: Use guint8 for opacity internally



commit b37223b9bbe5015e3638f21bc87f2c981f03c8a9
Author: Nirbheek Chauhan <nirbheek chauhan gmail com>
Date:   Thu Apr 10 12:11:22 2014 +0530

    window: Use guint8 for opacity internally
    
    Except while reading _NET_WM_WINDOW_OPACITY, opacity is between 0 and 255. With
    guint8, we'll get compiler warnings if arbitrary int values are passed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727874

 src/core/window-private.h |    6 +++---
 src/core/window.c         |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 374bca7..cf69a7d 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -370,8 +370,8 @@ struct _MetaWindow
   /* the input shape region for picking */
   cairo_region_t *input_region;
 
-  /* _NET_WM_WINDOW_OPACITY */
-  guint opacity;
+  /* _NET_WM_WINDOW_OPACITY rescaled to 0xFF */
+  guint8 opacity;
 
   /* if TRUE, the we have the new form of sync request counter which
    * also handles application frames */
@@ -731,7 +731,7 @@ void meta_window_set_transient_for        (MetaWindow *window,
                                            MetaWindow *parent);
 
 void meta_window_set_opacity              (MetaWindow *window,
-                                           guint       opacity);
+                                           guint8      opacity);
 
 void meta_window_set_custom_frame_extents (MetaWindow *window,
                                            GtkBorder  *extents);
diff --git a/src/core/window.c b/src/core/window.c
index 5729d57..98f561a 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -9129,7 +9129,7 @@ meta_window_set_transient_for (MetaWindow *window,
 
 void
 meta_window_set_opacity (MetaWindow *window,
-                         guint       opacity)
+                         guint8      opacity)
 {
   window->opacity = opacity;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]