[Goodies-commits] r6262 - xfce4-screenshooter-plugin/trunk/lib

Jerome Guelfucci jeromeg at xfce.org
Wed Dec 3 19:19:05 CET 2008


Author: jeromeg
Date: 2008-12-03 18:19:05 +0000 (Wed, 03 Dec 2008)
New Revision: 6262

Modified:
   xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
Log:
Try to improve a bit the grabbing of borders

Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c	2008-12-03 16:13:23 UTC (rev 6261)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c	2008-12-03 18:19:05 UTC (rev 6262)
@@ -92,8 +92,8 @@
     }
   else
     {
-      window2 = gdk_window_foreign_new (find_toplevel_window 
-                                        (GDK_WINDOW_XID (window)));
+      window2 = gdk_window_get_toplevel (window);
+      
       g_object_unref (window);
           
       window = window2;
@@ -107,27 +107,25 @@
 static GdkPixbuf
 *get_window_screenshot (GdkWindow *window)
 {
-  gint x_real_orig, y_real_orig, x_orig, y_orig;
-  gint width, real_width, height, real_height;
+  gint x_orig, y_orig;
+  gint width, height;
   GdkPixbuf *screenshot;
   GdkWindow *root;
+  GdkRectangle *rectangle = g_new0 (GdkRectangle, 1);
     
   /* Get the root window */
   root = gdk_get_default_root_window ();
   
   /* Based on gnome-screenshot code */
+
+  gdk_window_get_frame_extents (window, rectangle);
     
-  /* Get the size and the origin of the part of the screen we want to 
-   * screenshot. */
-  gdk_drawable_get_size (window, &real_width, &real_height);      
-  gdk_window_get_origin (window, &x_real_orig, &y_real_orig);
-  
   /* Don't grab thing offscreen. */
     
-  x_orig = x_real_orig;
-  y_orig = y_real_orig;
-  width  = real_width;
-  height = real_height;
+  x_orig = rectangle->x;
+  y_orig = rectangle->y;
+  width  = rectangle->width;
+  height = rectangle->height;
 
   if (x_orig < 0)
     {




More information about the Goodies-commits mailing list