[Goodies-commits] r7148 - in xfce4-screenshooter/trunk: . lib

Jerome Guelfucci jeromeg at xfce.org
Thu Apr 9 19:32:35 CEST 2009


Author: jeromeg
Date: 2009-04-09 17:32:35 +0000 (Thu, 09 Apr 2009)
New Revision: 7148

Modified:
   xfce4-screenshooter/trunk/ChangeLog
   xfce4-screenshooter/trunk/lib/screenshooter-utils.c
Log:
Try to fix bug 5204

Modified: xfce4-screenshooter/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter/trunk/ChangeLog	2009-04-09 16:21:57 UTC (rev 7147)
+++ xfce4-screenshooter/trunk/ChangeLog	2009-04-09 17:32:35 UTC (rev 7148)
@@ -1,3 +1,8 @@
+2009-04-09 jeromeg
+
+  * lib/screenshooter-utils.c: try to fix bug #5204 where the cursor
+    was not displayed at the correct location.
+
 2009-03-30 jeromeg
 
   * CONTRIBUTORS: update the contributors list.

Modified: xfce4-screenshooter/trunk/lib/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter/trunk/lib/screenshooter-utils.c	2009-04-09 16:21:57 UTC (rev 7147)
+++ xfce4-screenshooter/trunk/lib/screenshooter-utils.c	2009-04-09 17:32:35 UTC (rev 7148)
@@ -159,13 +159,13 @@
 
             TRACE ("Get the coordinates of the cursor");
         
-            gdk_window_get_pointer (window, &cursorx, &cursory, NULL);
+            gdk_window_get_pointer (root, &cursorx, &cursory, NULL);
 
-            TRACE ("Get the hot-spot x and y values");
-            
+            TRACE ("Get the cursor hotspot");
+
             sscanf (gdk_pixbuf_get_option (cursor_pixbuf, "x_hot"), "%d", &xhot);
             sscanf (gdk_pixbuf_get_option (cursor_pixbuf, "y_hot"), "%d", &yhot);
-
+            
             /* rectangle_window stores the window coordinates */
             rectangle_window.x = x_orig;
             rectangle_window.y = y_orig;
@@ -173,8 +173,8 @@
             rectangle_window.height = height;
             
             /* rectangle_cursor stores the cursor coordinates */
-            rectangle_cursor.x = cursorx + x_orig;
-            rectangle_cursor.y = cursory + y_orig;
+            rectangle_cursor.x = cursorx;
+            rectangle_cursor.y = cursory;
             rectangle_cursor.width = gdk_pixbuf_get_width (cursor_pixbuf);
             rectangle_cursor.height = gdk_pixbuf_get_height (cursor_pixbuf);
             
@@ -186,9 +186,9 @@
                 TRACE ("Compose the two pixbufs");
 
                 gdk_pixbuf_composite (cursor_pixbuf, screenshot,
-                                      cursorx - xhot, cursory - yhot,
+                                      cursorx - x_orig -xhot, cursory - y_orig -yhot,
                                       rectangle_cursor.width, rectangle_cursor.height,
-                                      cursorx - xhot, cursory - yhot,
+                                      cursorx - x_orig - xhot, cursory - y_orig -yhot,
                                       1.0, 1.0,
                                       GDK_INTERP_BILINEAR,
                                       255);




More information about the Goodies-commits mailing list