diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-06-19 23:53:28 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-06-19 23:53:28 +0000 |
commit | 219aa66d5da397921b2d0020eff888ad18e45789 (patch) | |
tree | 70c912aa4d89fb96673cfdc7ead78b8775e721cf /gtk/gtktrayicon-x11.c | |
parent | e13ccaa9570d824822313a516de5d58b16e9f33a (diff) | |
download | gtk+-219aa66d5da397921b2d0020eff888ad18e45789.tar.gz |
Make transparent tray icons work. (#320034, based on a patch by Dan
2006-06-19 Matthias Clasen <mclasen@redhat.com>
Make transparent tray icons work. (#320034, based on a
patch by Dan Winship)
* gtk/gtktrayicon-x11.c (gtk_tray_icon_init): Make trayicons
app-paintable and non-double buffered.
* gtk/gtkrc.c (_gtk_rc_init): Give tray icons a parent-relative
background in the default style.
Diffstat (limited to 'gtk/gtktrayicon-x11.c')
-rwxr-xr-x | gtk/gtktrayicon-x11.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c index 47badf7912..1c44ca0cb3 100755 --- a/gtk/gtktrayicon-x11.c +++ b/gtk/gtktrayicon-x11.c @@ -69,6 +69,8 @@ static void gtk_tray_icon_realize (GtkWidget *widget); static void gtk_tray_icon_unrealize (GtkWidget *widget); static gboolean gtk_tray_icon_delete (GtkWidget *widget, GdkEventAny *event); +static gboolean gtk_tray_icon_expose (GtkWidget *widget, + GdkEventExpose *event); static void gtk_tray_icon_update_manager_window (GtkTrayIcon *icon, gboolean dock_if_realized); @@ -87,6 +89,7 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class) widget_class->realize = gtk_tray_icon_realize; widget_class->unrealize = gtk_tray_icon_unrealize; widget_class->delete_event = gtk_tray_icon_delete; + widget_class->expose_event = gtk_tray_icon_expose; g_object_class_install_property (gobject_class, PROP_ORIENTATION, @@ -108,7 +111,9 @@ gtk_tray_icon_init (GtkTrayIcon *icon) icon->priv->stamp = 1; icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL; - + + gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE); + gtk_widget_set_double_buffered (GTK_WIDGET (icon), FALSE); gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK); } @@ -131,6 +136,19 @@ gtk_tray_icon_get_property (GObject *object, } } +static gboolean +gtk_tray_icon_expose (GtkWidget *widget, + GdkEventExpose *event) +{ + gdk_window_clear_area (widget->window, event->area.x, event->area.y, + event->area.width, event->area.height); + + if (GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event) + return GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event (widget, event); + + return FALSE; +} + static void gtk_tray_icon_get_orientation_property (GtkTrayIcon *icon) { |