From 35d540dd3c9269ec39bf3bc10a98b9714963291b Mon Sep 17 00:00:00 2001 From: Laszlo Boros Date: Sat, 26 Oct 2013 14:27:58 +0200 Subject: Starting to add GTK3 support --- src/tools/marco-mag.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/tools/marco-mag.c') 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 #include +#if GTK_CHECK_VERSION(3, 0, 0) + #include +#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) { -- cgit v1.2.1