summaryrefslogtreecommitdiff
path: root/trashapplet/src/xstuff.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-20 09:31:35 +0100
committerStefano Karapetsas <[email protected]>2014-01-20 09:31:35 +0100
commit7779705809b61a180aeb2371afcf8d0cba9ba0e3 (patch)
tree9d0d1c191f55ca46d54f6cc0a021556f2b1aad06 /trashapplet/src/xstuff.c
parent3da42cef82ee714a2271849275dfeea3b03ed508 (diff)
downloadmate-applets-7779705809b61a180aeb2371afcf8d0cba9ba0e3.tar.bz2
mate-applets-7779705809b61a180aeb2371afcf8d0cba9ba0e3.tar.xz
trashapplet: Add GTK3 support
Diffstat (limited to 'trashapplet/src/xstuff.c')
-rw-r--r--trashapplet/src/xstuff.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/trashapplet/src/xstuff.c b/trashapplet/src/xstuff.c
index 0458f182..75ae8eb3 100644
--- a/trashapplet/src/xstuff.c
+++ b/trashapplet/src/xstuff.c
@@ -24,6 +24,11 @@
#include "xstuff.h"
+#if GTK_CHECK_VERSION (3, 0, 0)
+#define GDK_WINDOW_XWINDOW(x) GDK_WINDOW_XID(x)
+#define gdk_x11_drawable_get_xid(x) GDK_WINDOW_XID(x)
+#endif
+
static Atom
panel_atom_get (const char *atom_name)
{
@@ -177,11 +182,13 @@ xstuff_is_compliant_wm (void)
return TRUE;
}
+#if !GTK_CHECK_VERSION (3, 0, 0)
gboolean
xstuff_net_wm_supports (const char *hint)
{
return gdk_net_wm_supports (gdk_atom_intern (hint, FALSE));
}
+#endif
void
xstuff_set_no_group (GdkWindow *win)
@@ -337,11 +344,17 @@ draw_zoom_animation (GdkScreen *gscreen,
dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (gscreen));
root_win = gdk_x11_drawable_get_xid (gdk_screen_get_root_window (gscreen));
screen = gdk_screen_get_number (gscreen);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ depth = DefaultDepth(dpy,screen);
+#else
depth = gdk_drawable_get_depth (gdk_screen_get_root_window (gscreen));
+#endif
/* frame GC */
+#if !GTK_CHECK_VERSION (3, 0, 0)
gdk_colormap_alloc_color (
gdk_screen_get_system_colormap (gscreen), &color, FALSE, TRUE);
+#endif
gcv.function = GXxor;
/* this will raise the probability of the XORed color being different
* of the original color in PseudoColor when not all color cells are
@@ -432,8 +445,10 @@ draw_zoom_animation (GdkScreen *gscreen,
XUngrabServer(dpy);
XFreeGC (dpy, frame_gc);
+#if !GTK_CHECK_VERSION (3, 0, 0)
gdk_colormap_free_colors (gdk_screen_get_system_colormap (gscreen),
&color, 1);
+#endif
}
#undef FRAMES
@@ -484,7 +499,11 @@ xstuff_get_current_workspace (GdkScreen *screen)
gdk_screen_get_root_window (screen));
gdk_error_trap_push ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ result = XGetWindowProperty (GDK_SCREEN_XDISPLAY (screen),
+#else
result = XGetWindowProperty (gdk_display,
+#endif
root_window,
panel_atom_get ("_NET_CURRENT_DESKTOP"),
0, G_MAXLONG,