summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-19 21:36:42 +0100
committerStefano Karapetsas <[email protected]>2014-01-19 21:36:42 +0100
commit3da42cef82ee714a2271849275dfeea3b03ed508 (patch)
treec998ccf81021603e037f6f20f872fd792adc95a8 /stickynotes/stickynotes.c
parentbc342abd6a3f49a1b1eff3b9d7121841e29053e3 (diff)
downloadmate-applets-3da42cef82ee714a2271849275dfeea3b03ed508.tar.bz2
mate-applets-3da42cef82ee714a2271849275dfeea3b03ed508.tar.xz
stickynotes: Add GTK3 support
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r--stickynotes/stickynotes.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 1796ebae..d38aee3f 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -46,7 +46,11 @@ set_icon_geometry (GdkWindow *window,
int height)
{
gulong data[4];
+#if GTK_CHECK_VERSION (3, 0, 0)
+ Display *dpy = gdk_x11_display_get_xdisplay (gdk_window_get_display (window));
+#else
Display *dpy = gdk_x11_drawable_get_xdisplay (window);
+#endif
data[0] = x;
data[1] = y;
@@ -56,7 +60,11 @@ set_icon_geometry (GdkWindow *window,
XChangeProperty (dpy,
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_display (window),
+#else
gdk_drawable_get_display (window),
+#endif
"_NET_WM_ICON_GEOMETRY"),
XA_CARDINAL, 32, PropModeReplace,
(guchar *)&data, 4);
@@ -485,10 +493,12 @@ stickynote_set_color (StickyNote *note,
gdk_color_parse ("black", &colors[4]);
gdk_color_parse ("white", &colors[5]);
+#if !GTK_CHECK_VERSION (3, 0, 0)
/* Allocate these colors */
gdk_colormap_alloc_colors (gtk_widget_get_colormap (
note->w_window),
colors, 6, FALSE, TRUE, success);
+#endif
/* Apply colors to style */
rc_style->base[GTK_STATE_NORMAL] = colors[0];