summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-07-06 20:47:05 +0200
committerinfirit <[email protected]>2015-07-06 20:47:05 +0200
commitf6266a3841757c5a1d284f3726a9e262dd1a6aa5 (patch)
treeadaf1a520c5ab33c23d7015894325147491da4a6
parent069182d3b7eb3cbe831f3c486d474129a4a69c70 (diff)
downloadmate-sensors-applet-f6266a3841757c5a1d284f3726a9e262dd1a6aa5.tar.bz2
mate-sensors-applet-f6266a3841757c5a1d284f3726a9e262dd1a6aa5.tar.xz
fix repainting of applet's background
This bring the code inline with gnome-sensors-applet.
-rw-r--r--sensors-applet/sensors-applet.c51
1 files changed, 4 insertions, 47 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c
index c047a1d..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);
- g_object_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);