diff options
author | infirit <[email protected]> | 2015-07-07 01:00:40 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2015-07-07 01:19:55 +0200 |
commit | 148eab649fa789ae1bfc1a0c7cfb59866045d525 (patch) | |
tree | adaf1a520c5ab33c23d7015894325147491da4a6 | |
parent | e85b0f646c3e5713ab18a59f223edf87199afb0c (diff) | |
download | mate-sensors-applet-148eab649fa789ae1bfc1a0c7cfb59866045d525.tar.bz2 mate-sensors-applet-148eab649fa789ae1bfc1a0c7cfb59866045d525.tar.xz |
fix repainting of applet's background
Taken from gnome-sensors-applet,
Commit: 3d69ff2e19b57c2f23270f10a83a91fa5cce8716
From: Lucian Langa <[email protected]>
-rw-r--r-- | sensors-applet/sensors-applet.c | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c index bc62f35..e180346 100644 --- a/sensors-applet/sensors-applet.c +++ b/sensors-applet/sensors-applet.c @@ -123,47 +123,6 @@ static void destroy_cb(GtkWidget *widget, gpointer data) { return; } -#if !GTK_CHECK_VERSION (3, 0, 0) -static void change_background_cb(MatePanelApplet *applet, - MatePanelAppletBackgroundType type, - GdkColor *color, - GdkPixmap *pixmap, - gpointer *data) { - GtkRcStyle *rc_style; - GtkStyle *style; - - g_debug("change-background occurred"); - - /* reset style */ - gtk_widget_set_style(GTK_WIDGET(applet), NULL); - rc_style = gtk_rc_style_new(); - gtk_widget_modify_style(GTK_WIDGET(applet), rc_style); - gtk_rc_style_unref(rc_style); - - switch(type) { - case PANEL_COLOR_BACKGROUND: - gtk_widget_modify_bg(GTK_WIDGET(applet), - GTK_STATE_NORMAL, color); - break; - - case PANEL_PIXMAP_BACKGROUND: - style = gtk_style_copy(GTK_WIDGET(applet)->style); - 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(applet), style); - g_object_unref(style); - break; - - case PANEL_NO_BACKGROUND: - /* fall through */ - default: - break; - } -} -#endif - static void change_orient_cb (MatePanelApplet *applet, MatePanelAppletOrient orient, gpointer data) { @@ -1380,6 +1339,10 @@ void sensors_applet_init(SensorsApplet *sensors_applet) { GtkActionGroup *action_group; gchar *ui_path; + /* Have our background automatically painted. */ + mate_panel_applet_set_background_widget(MATE_PANEL_APPLET(sensors_applet->applet), + GTK_WIDGET(sensors_applet->applet)); + /* plugin functions are stored as name -> get_value_function pairs so * use standard string functions on hash table */ sensors_applet->plugins = g_hash_table_new(g_str_hash, @@ -1433,12 +1396,6 @@ void sensors_applet_init(SensorsApplet *sensors_applet) { G_CALLBACK(style_set_cb), sensors_applet); -#if !GTK_CHECK_VERSION (3, 0, 0) - g_signal_connect(sensors_applet->applet, "change_background", - G_CALLBACK(change_background_cb), - sensors_applet); -#endif - g_signal_connect(G_OBJECT(sensors_applet->applet), "change_orient", G_CALLBACK(change_orient_cb), sensors_applet); |