summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/test-dbus-applet.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-10-26 14:35:17 +0200
committerStefano Karapetsas <[email protected]>2013-10-26 14:35:17 +0200
commit16606e37b0ba6a2c2661433e0219a87df43a539c (patch)
treee6b8db102273d07b4e8efd318ed1e8c6d77a4024 /libmate-panel-applet/test-dbus-applet.c
parenta6efbbceb5b1122512cd01609eab99fe522d8435 (diff)
downloadmate-panel-16606e37b0ba6a2c2661433e0219a87df43a539c.tar.bz2
mate-panel-16606e37b0ba6a2c2661433e0219a87df43a539c.tar.xz
libmate-panel-applet: Add GTK3 support
Diffstat (limited to 'libmate-panel-applet/test-dbus-applet.c')
-rw-r--r--libmate-panel-applet/test-dbus-applet.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libmate-panel-applet/test-dbus-applet.c b/libmate-panel-applet/test-dbus-applet.c
index abcae5c0..f2033057 100644
--- a/libmate-panel-applet/test-dbus-applet.c
+++ b/libmate-panel-applet/test-dbus-applet.c
@@ -113,7 +113,11 @@ static void
test_applet_handle_background_change (TestApplet *applet,
MatePanelAppletBackgroundType type,
GdkColor *color,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ cairo_pattern_t *pattern,
+#else
GdkPixmap *pixmap,
+#endif
gpointer dummy)
{
GdkWindow *window = gtk_widget_get_window (applet->label);
@@ -121,16 +125,29 @@ test_applet_handle_background_change (TestApplet *applet,
switch (type) {
case PANEL_NO_BACKGROUND:
g_message ("Setting background to default");
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_set_background_pattern (window, NULL);
+#else
gdk_window_set_back_pixmap (window, NULL, FALSE);
+#endif
break;
case PANEL_COLOR_BACKGROUND:
g_message ("Setting background to #%2x%2x%2x",
color->red, color->green, color->blue);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_set_background_pattern (window, NULL);
+#else
gdk_window_set_back_pixmap (window, NULL, FALSE);
+#endif
break;
case PANEL_PIXMAP_BACKGROUND:
+#if GTK_CHECK_VERSION (3, 0, 0)
+ g_message ("Setting background to '%p'", pattern);
+ gdk_window_set_background_pattern (window, pattern);
+#else
g_message ("Setting background to '%p'", pixmap);
gdk_window_set_back_pixmap (window, pixmap, FALSE);
+#endif
break;
default:
g_assert_not_reached ();