summaryrefslogtreecommitdiff
path: root/src/tools/marco-mag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/marco-mag.c')
-rw-r--r--src/tools/marco-mag.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/marco-mag.c b/src/tools/marco-mag.c
index 4cb33183..5d6dff35 100644
--- a/src/tools/marco-mag.c
+++ b/src/tools/marco-mag.c
@@ -29,6 +29,10 @@
#include <stdlib.h>
#include <math.h>
+#if GTK_CHECK_VERSION(3, 0, 0)
+ #include <gdk/gdkkeysyms-compat.h>
+#endif
+
static GtkWidget *grab_widget = NULL;
static GtkWidget *display_window = NULL;
static int last_grab_x = 0;
@@ -52,10 +56,15 @@ get_pixbuf (void)
last_grab_width, last_grab_height);
#endif
+
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ screenshot = gdk_pixbuf_get_from_window(gdk_get_default_root_window(), last_grab_x, last_grab_y, last_grab_width, last_grab_height);
+ #else
screenshot = gdk_pixbuf_get_from_drawable (NULL, gdk_get_default_root_window (),
NULL,
last_grab_x, last_grab_y, 0, 0,
last_grab_width, last_grab_height);
+ #endif
if (screenshot == NULL)
{