X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=OSX%2Fosxgrabscreen.m;h=0138fcf41682682d60c9e153ef0e15f4cff5eb14;hp=f42ad34bc270b225534fcc76b8497e070ba77355;hb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;hpb=50be9bb40dc60130c99ffa568e6677779904ff70 diff --git a/OSX/osxgrabscreen.m b/OSX/osxgrabscreen.m index f42ad34b..0138fcf4 100644 --- a/OSX/osxgrabscreen.m +++ b/OSX/osxgrabscreen.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2010 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -10,6 +10,11 @@ */ /* This is the OSX implementation of desktop-grabbing and image-loading. + This code is invoked by "utils/grabclient.c", which is linked directly + in to each screen saver bundle. + + X11-based builds of the savers do not use this code (even on MacOS). + This is used only by the Cocoa build of the savers. */ #import @@ -216,8 +221,10 @@ osx_grab_desktop_image (Screen *screen, Window xwindow, Drawable drawable) // Splat the XImage onto the target drawable (probably the window) // and free the bits. // - GC gc = 0; + XGCValues gcv; + GC gc = XCreateGC (dpy, drawable, 0, &gcv); XPutImage (dpy, drawable, gc, xim, 0, 0, 0, 0, xim->width, xim->height); + XFreeGC (dpy, gc); XDestroyImage (xim); }