summaryrefslogtreecommitdiff
path: root/src/tools/marco-mag.c
diff options
context:
space:
mode:
authorLaszlo Boros <[email protected]>2013-10-26 14:27:58 +0200
committerStefano Karapetsas <[email protected]>2013-10-26 14:27:58 +0200
commit35d540dd3c9269ec39bf3bc10a98b9714963291b (patch)
treeae76b286839a6d3a6ebe309bdb7884bd35a3698d /src/tools/marco-mag.c
parent46ba8ca5fc9665c1a4758e56fda6761ac993c62e (diff)
downloadmarco-35d540dd3c9269ec39bf3bc10a98b9714963291b.tar.bz2
marco-35d540dd3c9269ec39bf3bc10a98b9714963291b.tar.xz
Starting to add GTK3 support
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)
{