Index: window.c
===================================================================
--- window.c	(révision 1211)
+++ window.c	(copie de travail)
@@ -91,6 +91,10 @@ struct _WnckWindowPrivate
   char *res_class;
   char *res_name;
   
+  guint32 opacity;
+  guint32 saturation;
+  guint32 brightness;
+  
   /* true if transient_for points to root window,
    * not another app window
    */
@@ -134,6 +138,10 @@ struct _WnckWindowPrivate
   guint need_update_startup_id : 1;
   guint need_update_wmclass : 1;
   guint need_update_wmhints : 1;
+  
+  guint need_update_opacity : 1;
+  guint need_update_saturation : 1;
+  guint need_update_brightness : 1;
 
   guint need_emit_name_changed : 1;
   guint need_emit_icon_changed : 1;
@@ -146,6 +154,9 @@ enum {
   ICON_CHANGED,
   ACTIONS_CHANGED,
   GEOMETRY_CHANGED,
+  OPACITY_CHANGED,
+  SATURATION_CHANGED,
+  BRIGHTNESS_CHANGED,
   LAST_SIGNAL
 };
 
@@ -174,6 +185,9 @@ static void update_wintype   (WnckWindow
 static void update_transient_for (WnckWindow *window);
 static void update_startup_id (WnckWindow *window);
 static void update_wmclass    (WnckWindow *window);
+static void update_opacity   (WnckWindow *window);
+static void update_saturation   (WnckWindow *window);
+static void update_brightness   (WnckWindow *window);
 static void unqueue_update   (WnckWindow *window);
 static void queue_update     (WnckWindow *window);
 static void force_update_now (WnckWindow *window);
@@ -293,6 +307,33 @@ wnck_window_class_init (WnckWindowClass 
                   NULL, NULL,
                   g_cclosure_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);  
+
+  signals[OPACITY_CHANGED] =
+    g_signal_new ("opacity_changed",
+                  G_OBJECT_CLASS_TYPE (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (WnckWindowClass, opacity_changed),
+                  NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);  
+
+  signals[SATURATION_CHANGED] =
+    g_signal_new ("saturation_changed",
+                  G_OBJECT_CLASS_TYPE (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (WnckWindowClass, saturation_changed),
+                  NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
+
+  signals[BRIGHTNESS_CHANGED] =
+    g_signal_new ("brightness_changed",
+                  G_OBJECT_CLASS_TYPE (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (WnckWindowClass, brightness_changed),
+                  NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
 }
 
 static void
@@ -421,6 +462,9 @@ _wnck_window_create (Window      xwindow
   window->priv->need_update_startup_id = TRUE;
   window->priv->need_update_wmclass = TRUE;
   window->priv->need_update_wmhints = TRUE;
+  window->priv->need_update_opacity = TRUE;
+  window->priv->need_update_saturation = TRUE;
+  window->priv->need_update_brightness = TRUE;
   window->priv->need_emit_name_changed = FALSE;
   window->priv->need_emit_icon_changed = FALSE;
   force_update_now (window);
@@ -1637,6 +1681,77 @@ wnck_window_set_geometry (WnckWindow    
                              gravity_and_flags, x, y, width, height);
 }
 
+guint
+wnck_window_get_opacity (WnckWindow *window)
+{
+  guint64 o;
+
+  g_return_val_if_fail (WNCK_IS_WINDOW (window), 0);
+
+  o = ((guint64) window->priv->opacity * 1005) / G_MAXUINT32;
+
+  return o / 10;
+}
+
+void
+wnck_window_set_opacity (WnckWindow *window,
+			 guint      opacity)
+{
+  g_return_if_fail (WNCK_IS_WINDOW (window));
+
+  _wnck_change_opacity (WNCK_SCREEN_XSCREEN (window->priv->screen),
+			wnck_window_get_xid (window),
+			(((guint64) opacity * G_MAXUINT32) / 100));
+}
+
+
+guint
+wnck_window_get_saturation (WnckWindow *window)
+{
+  guint64 o;
+
+  g_return_val_if_fail (WNCK_IS_WINDOW (window), 0);
+
+  o = ((guint64) window->priv->saturation * 1005) / G_MAXUINT32;
+
+  return o / 10;
+}
+
+void
+wnck_window_set_saturation (WnckWindow *window,
+			 guint      saturation)
+{
+  g_return_if_fail (WNCK_IS_WINDOW (window));
+
+  _wnck_change_saturation (WNCK_SCREEN_XSCREEN (window->priv->screen),
+			wnck_window_get_xid (window),
+			(((guint64) saturation * G_MAXUINT32) / 100));
+}
+
+
+guint
+wnck_window_get_brightness (WnckWindow *window)
+{
+  guint64 o;
+
+  g_return_val_if_fail (WNCK_IS_WINDOW (window), 0);
+
+  o = ((guint64) window->priv->brightness * 1005) / G_MAXUINT32;
+
+  return o / 10;
+}
+
+void
+wnck_window_set_brightness (WnckWindow *window,
+			 guint      brightness)
+{
+  g_return_if_fail (WNCK_IS_WINDOW (window));
+
+  _wnck_change_brightness (WNCK_SCREEN_XSCREEN (window->priv->screen),
+			wnck_window_get_xid (window),
+			(((guint64) brightness * G_MAXUINT32) / 100));
+}
+
 /**
  * wnck_window_is_visible_on_workspace:
  * @window: a #WnckWindow
@@ -1870,6 +1985,26 @@ _wnck_window_process_property_notify (Wn
       window->priv->need_update_wmhints = TRUE;
       queue_update (window);
     }
+  else if (xevent->xproperty.atom ==
+           _wnck_atom_get ("_NET_WM_WINDOW_OPACITY"))
+    {
+      window->priv->need_update_opacity = TRUE;
+      queue_update (window);
+    }
+
+  else if (xevent->xproperty.atom ==
+           _wnck_atom_get ("_NET_WM_WINDOW_SATURATION"))
+    {
+      window->priv->need_update_saturation = TRUE;
+      queue_update (window);
+    }
+
+  else if (xevent->xproperty.atom ==
+           _wnck_atom_get ("_NET_WM_WINDOW_BRIGHTNESS"))
+    {
+      window->priv->need_update_brightness = TRUE;
+      queue_update (window);
+    }
 }
 
 void
@@ -2396,6 +2531,39 @@ update_wmhints (WnckWindow *window)
 }
 
 static void
+update_opacity (WnckWindow *window)
+{
+  if (!window->priv->need_update_opacity)
+    return;
+
+  window->priv->need_update_opacity = FALSE;
+
+  window->priv->opacity = _wnck_get_opacity (window->priv->xwindow);
+}
+
+static void
+update_saturation (WnckWindow *window)
+{
+  if (!window->priv->need_update_saturation)
+    return;
+
+  window->priv->need_update_saturation = FALSE;
+
+  window->priv->saturation = _wnck_get_saturation (window->priv->xwindow);
+}
+
+static void
+update_brightness (WnckWindow *window)
+{
+  if (!window->priv->need_update_brightness)
+    return;
+
+  window->priv->need_update_brightness = FALSE;
+
+  window->priv->brightness = _wnck_get_brightness (window->priv->xwindow);
+}
+
+static void
 force_update_now (WnckWindow *window)
 {
   WnckWindowState old_state;
@@ -2430,6 +2598,9 @@ force_update_now (WnckWindow *window)
                               */
   update_workspace (window); /* emits signals */
   update_actions (window);
+  update_opacity (window);
+  update_saturation (window);
+  update_brightness (window);
 
   get_icons (window);
   
Index: window.h
===================================================================
--- window.h	(révision 1211)
+++ window.h	(copie de travail)
@@ -151,6 +151,15 @@ struct _WnckWindowClass
 
   /* Changed size/position */
   void (* geometry_changed)      (WnckWindow       *window);
+  
+  /* Changed opacity */
+  void (* opacity_changed)      (WnckWindow       *window);
+
+  /* Changed saturation */
+  void (* saturation_changed)      (WnckWindow       *window);
+
+  /* Changed brightness */
+  void (* brightness_changed)      (WnckWindow       *window);
 };
 
 GType wnck_window_get_type (void) G_GNUC_CONST;
@@ -266,6 +275,15 @@ void wnck_window_set_geometry (WnckWindo
                                int                       width,
                                int                       height);
 
+guint wnck_window_get_opacity (WnckWindow *window);
+void  wnck_window_set_opacity (WnckWindow *window, guint opacity);
+
+guint wnck_window_get_saturation (WnckWindow *window);
+void  wnck_window_set_saturation (WnckWindow *window, guint saturation);
+
+guint wnck_window_get_brightness (WnckWindow *window);
+void  wnck_window_set_brightness (WnckWindow *window, guint brightness);
+
 gboolean wnck_window_is_visible_on_workspace (WnckWindow    *window,
                                               WnckWorkspace *workspace);
 gboolean wnck_window_is_on_workspace         (WnckWindow    *window,
Index: xutils.c
===================================================================
--- xutils.c	(révision 1211)
+++ xutils.c	(copie de travail)
@@ -1091,6 +1091,87 @@ _wnck_toggle_showing_desktop (Screen  *s
 	      &xev);
 }
 
+void
+_wnck_change_opacity (Screen  *screen,
+		      Window  xwindow,
+		      guint32 opacity)
+{
+  XEvent xev;
+
+  xev.xclient.type = ClientMessage;
+  xev.xclient.serial = 0;
+  xev.xclient.send_event = True;
+  xev.xclient.display = gdk_display;
+  xev.xclient.window = xwindow;
+  xev.xclient.message_type = _wnck_atom_get ("_NET_WM_WINDOW_OPACITY");
+  xev.xclient.format = 32;
+  xev.xclient.data.l[0] = opacity;
+  xev.xclient.data.l[1] = 0;
+  xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
+
+  XSendEvent (gdk_display,
+	      RootWindowOfScreen (screen),
+	      False,
+	      SubstructureRedirectMask | SubstructureNotifyMask,
+	      &xev);
+}
+
+void
+_wnck_change_saturation (Screen  *screen,
+		      Window  xwindow,
+		      guint32 saturation)
+{
+  XEvent xev;
+
+  xev.xclient.type = ClientMessage;
+  xev.xclient.serial = 0;
+  xev.xclient.send_event = True;
+  xev.xclient.display = gdk_display;
+  xev.xclient.window = xwindow;
+  xev.xclient.message_type = _wnck_atom_get ("_NET_WM_WINDOW_SATURATION");
+  xev.xclient.format = 32;
+  xev.xclient.data.l[0] = saturation;
+  xev.xclient.data.l[1] = 0;
+  xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
+
+  XSendEvent (gdk_display,
+	      RootWindowOfScreen (screen),
+	      False,
+	      SubstructureRedirectMask | SubstructureNotifyMask,
+	      &xev);
+}
+
+void
+_wnck_change_brightness (Screen  *screen,
+		      Window  xwindow,
+		      guint32 brightness)
+{
+  XEvent xev;
+
+  xev.xclient.type = ClientMessage;
+  xev.xclient.serial = 0;
+  xev.xclient.send_event = True;
+  xev.xclient.display = gdk_display;
+  xev.xclient.window = xwindow;
+  xev.xclient.message_type = _wnck_atom_get ("_NET_WM_WINDOW_BRIGHTNESS");
+  xev.xclient.format = 32;
+  xev.xclient.data.l[0] = brightness;
+  xev.xclient.data.l[1] = 0;
+  xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
+
+  XSendEvent (gdk_display,
+	      RootWindowOfScreen (screen),
+	      False,
+	      SubstructureRedirectMask | SubstructureNotifyMask,
+	      &xev);
+}
+
 char*
 _wnck_get_session_id (Window xwindow)
 {
@@ -1211,6 +1292,45 @@ _wnck_get_wmclass (Window xwindow,
     }
 }
 
+guint32
+_wnck_get_opacity (Window xwindow)
+{
+  int val;
+
+  if (_wnck_get_cardinal (xwindow,
+			  _wnck_atom_get ("_NET_WM_WINDOW_OPACITY"),
+			  &val))
+      return val;
+
+  return G_MAXUINT32;
+}
+
+guint32
+_wnck_get_saturation (Window xwindow)
+{
+  int val;
+
+  if (_wnck_get_cardinal (xwindow,
+			  _wnck_atom_get ("_NET_WM_WINDOW_SATURATION"),
+			  &val))
+      return val;
+
+  return G_MAXUINT32;
+}
+
+guint32
+_wnck_get_brightness (Window xwindow)
+{
+  int val;
+
+  if (_wnck_get_cardinal (xwindow,
+			  _wnck_atom_get ("_NET_WM_WINDOW_BRIGHTNESS"),
+			  &val))
+      return val;
+
+  return G_MAXUINT32;
+}
+
 void
 _wnck_select_input (Window xwindow,
                     int    mask)
Index: xutils.h
===================================================================
--- xutils.h	(révision 1211)
+++ xutils.h	(copie de travail)
@@ -109,6 +109,16 @@ void _wnck_change_viewport (Screen *scre
 			    int     x,
 			    int     y);
 
+void _wnck_change_opacity (Screen  *screen,
+			   Window  xwindow,
+			   guint32 opacity);
+void _wnck_change_saturation (Screen  *screen,
+			   Window  xwindow,
+			   guint32 saturation);
+void _wnck_change_brightness (Screen  *screen,
+			   Window  xwindow,
+			   guint32 brightness);
+
 char*  _wnck_get_session_id     (Window xwindow);
 int    _wnck_get_pid            (Window xwindow);
 char*  _wnck_get_name           (Window xwindow);
@@ -117,6 +127,12 @@ void   _wnck_get_wmclass        (Window 
                                  char **res_class,
                                  char **res_name);
 
+guint32 _wnck_get_opacity (Window xwindow);
+
+guint32 _wnck_get_saturation (Window xwindow);
+
+guint32 _wnck_get_brightness (Window xwindow);
+
 void   _wnck_select_input     (Window xwindow,
                                int    mask);
 
