X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fgrabscreen.c;h=77fe3c96bd4c5d5130bc8e337aa6a88e31136b12;hb=c85f503f5793839a6be4c818332aca4a96927bb2;hp=00a96de4c91ef70a45be0ff207ec2194412db8fc;hpb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;p=xscreensaver diff --git a/utils/grabscreen.c b/utils/grabscreen.c index 00a96de4..77fe3c96 100644 --- a/utils/grabscreen.c +++ b/utils/grabscreen.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2006 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2016 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 @@ -18,16 +18,28 @@ The hacks themselves use utils/grabclient.c to invoke the "xscreensaver-getimage" program as a sub-process. - This code is linked only into "driver/xscreensaver-getimage". On normal - X11 systems, "xscreensaver-getimage.c" invokes the code in this file. + On "real" X11 systems: - However, under X11 on MacOS, "xscreensaver-getimage" instead runs the - script "driver/xscreensaver-getimage-desktop", which invokes the MacOS- - specific program "/usr/sbin/screencapture" to get the desktop image. + "driver/xscreensaver-getimage" runs the code in this file to grab + the X11 root window image as a Pixmap. - However again, for the MacOS-native (Cocoa) build of the screen savers, - "utils/grabclient.c" instead links against "OSX/osxgrabscreen.m", which - grabs screen images directly without invoking a sub-process to do it. + On MacOS systems running X11, which nobody does any more: + + "driver/xscreensaver-getimage" runs the Perl script + "driver/xscreensaver-getimage-desktop", which in turn runs the MacOS + program "/usr/sbin/screencapture" to get the Mac desktop image as a + PNG file. + + On MacOS systems running the native Cocoa build, or on iOS or Android + systems: + + "driver/xscreensaver-getimage" is not used. Instead, each saver's + "utils/grabclient.c" links against "OSX/grabclient-osx.m", + "OSX/grabclient-ios.m" or "jwxyz/jwxyz-android.c" to grab + screenshots directly without invoking a sub-process to do it. + + See the comment at the top of utils/grabclient.c for a more detailed + explanation. */ #include "utils.h" @@ -477,7 +489,7 @@ copy_default_colormap_contents (Screen *screen, XQueryColors (dpy, from_cmap, old_colors, max_cells); got_cells = max_cells; - allocate_writable_colors (dpy, to_cmap, pixels, &got_cells); + allocate_writable_colors (screen, to_cmap, pixels, &got_cells); if (grab_verbose_p && got_cells != max_cells) fprintf(stderr, "%s: got only %d of %d cells\n", progname,