summaryrefslogtreecommitdiff
path: root/src/shell-tray-manager.c
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2009-04-18 17:06:14 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2009-04-18 17:06:14 -0400
commita0dcee1b8176d746c1591b1a35b7fc749e522e2d (patch)
tree12367b326f97f102f7ff11d93fc3a4043dfda6a6 /src/shell-tray-manager.c
parent58e718ac0c118993030f16f3b2ac3940e45cd45a (diff)
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.
Diffstat (limited to 'src/shell-tray-manager.c')
-rw-r--r--src/shell-tray-manager.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/shell-tray-manager.c b/src/shell-tray-manager.c
index 57a11679..fef819e3 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);