X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=OSX%2Fgrabclient-osx.m;h=7bfdcb4fa811b0e921dbd585f571b2422e4e39c2;hb=c85f503f5793839a6be4c818332aca4a96927bb2;hp=8542d12786111d6ad1d7006a729129a227369acf;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba;p=xscreensaver diff --git a/OSX/grabclient-osx.m b/OSX/grabclient-osx.m index 8542d127..7bfdcb4f 100644 --- a/OSX/grabclient-osx.m +++ b/OSX/grabclient-osx.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2017 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2018 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 @@ -286,6 +286,8 @@ osx_grab_desktop_image (Screen *screen, Window xwindow, Drawable drawable, use it if when being compiled against the 10.5 SDK or later. */ +extern float jwxyz_scale (Window); /* jwxyzI.h */ + /* Loads an image into the Drawable, returning once the image is loaded. */ Bool @@ -307,10 +309,11 @@ osx_grab_desktop_image (Screen *screen, Window xwindow, Drawable drawable, // Grab only the rectangle of the screen underlying this window. // CGRect cgrect; + double s = jwxyz_scale (xwindow); cgrect.origin.x = window_x; cgrect.origin.y = window_y; - cgrect.size.width = xgwa.width; - cgrect.size.height = xgwa.height; + cgrect.size.width = xgwa.width / s; + cgrect.size.height = xgwa.height / s; /* If a password is required to unlock the screen, a large black window will be on top of all of the desktop windows by the time @@ -339,6 +342,7 @@ osx_grab_desktop_image (Screen *screen, Window xwindow, Drawable drawable, (NSString *)kCGWindowNumber]).intValue; } } + CFRelease (L); } // Grab a screen shot of those windows below this one