62
62
static void egg_tray_icon_realize (GtkWidget *widget);
63
63
static void egg_tray_icon_unrealize (GtkWidget *widget);
65
static void egg_tray_icon_add (GtkContainer *container,
65
68
static void egg_tray_icon_update_manager_window (EggTrayIcon *icon);
105
108
GObjectClass *gobject_class = (GObjectClass *)klass;
106
109
GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
110
GtkContainerClass *container_class = (GtkContainerClass *)klass;
108
112
parent_class = g_type_class_peek_parent (klass);
112
116
widget_class->realize = egg_tray_icon_realize;
113
117
widget_class->unrealize = egg_tray_icon_unrealize;
119
container_class->add = egg_tray_icon_add;
115
121
g_object_class_install_property (gobject_class,
116
122
PROP_ORIENTATION,
117
123
g_param_spec_enum ("orientation",
340
transparent_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
342
gdk_window_clear_area (widget->window, event->area.x, event->area.y,
343
event->area.width, event->area.height);
348
make_transparent_again (GtkWidget *widget, GtkStyle *previous_style,
351
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
355
make_transparent (GtkWidget *widget, gpointer user_data)
357
if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget))
360
gtk_widget_set_app_paintable (widget, TRUE);
361
gtk_widget_set_double_buffered (widget, FALSE);
362
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
363
g_signal_connect (widget, "expose_event",
364
G_CALLBACK (transparent_expose_event), NULL);
365
g_signal_connect_after (widget, "style_set",
366
G_CALLBACK (make_transparent_again), NULL);
334
370
egg_tray_icon_realize (GtkWidget *widget)
343
379
if (GTK_WIDGET_CLASS (parent_class)->realize)
344
380
GTK_WIDGET_CLASS (parent_class)->realize (widget);
382
make_transparent (widget, NULL);
346
384
screen = gtk_widget_get_screen (widget);
347
385
display = gdk_screen_get_display (screen);
348
386
xdisplay = gdk_x11_display_get_xdisplay (display);
373
411
egg_tray_icon_manager_filter, icon);
415
egg_tray_icon_add (GtkContainer *container, GtkWidget *widget)
417
g_signal_connect (widget, "realize",
418
G_CALLBACK (make_transparent), NULL);
419
GTK_CONTAINER_CLASS (parent_class)->add (container, widget);
377
423
egg_tray_icon_new_for_xscreen (Screen *xscreen, const char *name)