[gtk+/gtk-2-24] [Bug 676362] _gdk_quartz_image_copy_to_image always returns black for the root window



commit da324fa2d5723739b9a74996e1e11df93b300aec
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Wed Jun 13 17:21:56 2012 +0100

    [Bug 676362] _gdk_quartz_image_copy_to_image always returns black for
    the root window
    
    Revised patch which doesn't depend upon NSRect being typdeffed from
    CGRect (64-bit only).

 gdk/quartz/gdkimage-quartz.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gdk/quartz/gdkimage-quartz.c b/gdk/quartz/gdkimage-quartz.c
index ce032aa..1d4f8d7 100644
--- a/gdk/quartz/gdkimage-quartz.c
+++ b/gdk/quartz/gdkimage-quartz.c
@@ -131,16 +131,14 @@ _gdk_quartz_image_copy_to_image (GdkDrawable *drawable,
     {
       GdkQuartzView *view;
       NSBitmapImageRep *rep;
-      NSRect rect;
       guchar *data;
       int x, y;
       NSSize size;
-            
-      rect = NSMakeRect (src_x, src_y, width, height);
-      
+
       if (GDK_WINDOW_IMPL_QUARTZ (drawable) == GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl))
         {
           /* Special case for the root window. */
+	  CGRect rect = CGRectMake (src_x, src_y, width, height);
           CGImageRef root_image_ref = CGWindowListCreateImage (rect,
                                                                kCGWindowListOptionOnScreenOnly,
                                                                kCGNullWindowID,
@@ -150,6 +148,7 @@ _gdk_quartz_image_copy_to_image (GdkDrawable *drawable,
         }
       else
         {
+	  NSRect rect = NSMakeRect (src_x, src_y, width, height);
           view = GDK_WINDOW_IMPL_QUARTZ (drawable)->view;
 
           /* We return the image even if we can't copy to it. */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]