From e6e51a29a89cc95019d5e97b36ba48803c5cd58b Mon Sep 17 00:00:00 2001 From: Monsta Date: Mon, 31 Aug 2015 15:39:09 +0300 Subject: geyes: have applet background automatically painted --- geyes/geyes.c | 53 +---------------------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) (limited to 'geyes') diff --git a/geyes/geyes.c b/geyes/geyes.c index 1652aaf3..34599102 100644 --- a/geyes/geyes.c +++ b/geyes/geyes.c @@ -32,54 +32,6 @@ #define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) #endif -static void -applet_back_change (MatePanelApplet *a, - MatePanelAppletBackgroundType type, - GdkColor *color, -#if GTK_CHECK_VERSION (3, 0, 0) - cairo_pattern_t *pattern, -#else - GdkPixmap *pixmap, -#endif - EyesApplet *eyes_applet) -{ -#if !GTK_CHECK_VERSION (3, 0, 0) - /* taken from the TrashApplet */ - GtkRcStyle *rc_style; - GtkStyle *style; - - /* reset style */ - gtk_widget_set_style (GTK_WIDGET (eyes_applet->applet), NULL); - rc_style = gtk_rc_style_new (); - gtk_widget_modify_style (GTK_WIDGET (eyes_applet->applet), rc_style); - g_object_unref (rc_style); - - switch (type) { - case PANEL_COLOR_BACKGROUND: - gtk_widget_modify_bg (GTK_WIDGET (eyes_applet->applet), - GTK_STATE_NORMAL, color); - break; - - case PANEL_PIXMAP_BACKGROUND: - style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET ( - eyes_applet->applet))); - if (style->bg_pixmap[GTK_STATE_NORMAL]) - g_object_unref - (style->bg_pixmap[GTK_STATE_NORMAL]); - style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref - (pixmap); - gtk_widget_set_style (GTK_WIDGET (eyes_applet->applet), - style); - g_object_unref (style); - break; - - case PANEL_NO_BACKGROUND: - default: - break; - } -#endif -} - /* TODO - Optimize this a bit */ static void calculate_pupil_xy (EyesApplet *eyes_applet, @@ -422,6 +374,7 @@ geyes_applet_fill (MatePanelApplet *applet) gtk_window_set_default_icon_name ("mate-eyes-applet"); mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR); + mate_panel_applet_set_background_widget (applet, GTK_WIDGET (applet)); eyes_applet = create_eyes (applet); @@ -452,10 +405,6 @@ geyes_applet_fill (MatePanelApplet *applet) set_atk_name_description (GTK_WIDGET (eyes_applet->applet), _("Eyes"), _("The eyes look in the direction of the mouse pointer")); - g_signal_connect (eyes_applet->applet, - "change_background", - G_CALLBACK (applet_back_change), - eyes_applet); g_signal_connect (eyes_applet->vbox, "dispose", G_CALLBACK (dispose_cb), -- cgit v1.2.1