[gnome-shell] Fix drawing of icons with alpha transparency



commit a0dcee1b8176d746c1591b1a35b7fc749e522e2d
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Apr 18 17:06:14 2009 -0400

    Fix drawing of icons with alpha transparency
    
    Icons with real alpha transparency weren't being drawn correctly
    because the NaTrayIcon was being set redirected in addition to the
    window holding it. And nothing drew the icon onto the window holding
    it. Use the newly added na_tray_icon_set_composited() to fix.
---
 src/shell-tray-manager.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/shell-tray-manager.c b/src/shell-tray-manager.c
index 57a1167..fef819e 100644
--- a/src/shell-tray-manager.c
+++ b/src/shell-tray-manager.c
@@ -236,6 +236,14 @@ na_tray_icon_added (NaTrayManager *na_manager, GtkWidget *socket,
   ShellTrayManagerChild *child;
   GdkPixmap *bg_pixmap;
 
+  /* We don't need the NaTrayIcon to be composited on the window we
+   * put it in: the window is the same size as the tray icon
+   * and transparent. We can just use the default X handling of
+   * subwindows as mode of SOURCE (replace the parent with the
+   * child) and then composite the parent onto the stage.
+   */
+  na_tray_child_set_composited (NA_TRAY_CHILD (socket), FALSE);
+
   win = gtk_window_new (GTK_WINDOW_POPUP);
   gtk_container_add (GTK_CONTAINER (win), socket);
 
@@ -252,11 +260,8 @@ na_tray_icon_added (NaTrayManager *na_manager, GtkWidget *socket,
    * that color and setting it as our background. Then "parent-relative"
    * background on the socket and the plug within that will cause
    * the icons contents to appear on top of our background color.
-   *
-   * Ordering warning: na_tray_child_is_composited() doesn't work
-   *   until the tray child has been realized.
    */
-  if (!na_tray_child_is_composited (NA_TRAY_CHILD (socket)))
+  if (!na_tray_child_has_alpha (NA_TRAY_CHILD (socket)))
     {
       bg_pixmap = create_bg_pixmap (gtk_widget_get_colormap (win),
                                     &manager->priv->bg_color);



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