views:

7

answers:

0

Hello,

In my gtk+ application i try to take full screen screenshot.

My code:

GdkPixbuf* get_screenshot(gpointer user_data)
{
   GError* err;
   GdkPixbuf *screenshot;
   GdkWindow *root_window;

   MainWin* mw = MAIN_WIN(user_data);

   gint x_orig, y_orig;
   gint width, height;

   root_window = gdk_get_default_root_window ();

   gdk_drawable_get_size (root_window, &width, &height);      
   gdk_window_get_origin (root_window, &x_orig, &y_orig);

   screenshot = gdk_pixbuf_get_from_drawable (NULL, root_window, NULL,
                                              x_orig, y_orig, 0, 0, width, height);

   gtk_image_view_set_pixbuf(mw->aview, screenshot, TRUE);  

   g_object_unref( root_window);

   return screenshot;
}

But when i try to call this function, occurs screenshot taker but without the cursor. How to make a cursor that would be captured?

Thank you