CGWindowListCreateImage is capturing scaled cursors

Originator:andrews
Number:rdar://44198903 Date Originated:06-Sep-2018 02:57 PM
Status:Open Resolved:
Product:macOS + SDK Product Version:10.13.6 (17G65)
Classification:UI/Usability Reproducible:Always
 
Summary:
When calling CGWindowListCreateImage and the accessibility scaling of the cursor is above 2.7, the cursor will show up in the image. This behavior is not expected. 

Steps to Reproduce:
Set cursor scale to something beyond halfway within the accessibility options. 

CGRect area = CGRectMake(mouseLocation.x, mouseLocation.y, 1, 1);
CGImageRef image = CGWindowListCreateImage(area, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault);

Expected Results:
Should provide a 1x1 image at the current location of the mouse. 

Actual Results:
Provides a 1x1 image that is always white because the cursor is blocking the image. 

Version:
10.13.6 (17G65)

Notes:
In order to work around this, we temporarily scale the cursor to something below the 2.7 threshold so we can capture the proper image.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!