mac-capture: Fix display capture cursor bug

The kCGDisplayStreamShowCursor option used with the dictionary does not
work if you assign @true or @false to it.  After some testing, it needs
to point to the id cast of either kCFBooleanTrue or kCFBooleanFalse in
order for it to work properly.

If it doesn't use either of those values, the display stream seems to
use its internal default, which on 10.8 and 10.9 is visible, and 10.10+
is invisible, which would explain why people on 10.10 couldn't get the
cursor to capture.
master
jp9000 2015-03-30 23:53:52 -07:00
parent 453b505637
commit a892fa9e33
1 changed files with 4 additions and 1 deletions

View File

@ -198,11 +198,14 @@ static bool init_display_stream(struct display_capture *dc)
dc->screen.frame.size.width,
dc->screen.frame.size.height)));
CFBooleanRef show_cursor_cf =
dc->hide_cursor ? kCFBooleanFalse : kCFBooleanTrue;
NSDictionary *dict = @{
(__bridge NSString*)kCGDisplayStreamSourceRect: rect_dict,
(__bridge NSString*)kCGDisplayStreamQueueDepth: @5,
(__bridge NSString*)kCGDisplayStreamShowCursor:
@(!dc->hide_cursor),
(id)show_cursor_cf,
};
os_event_init(&dc->disp_finished, OS_EVENT_TYPE_MANUAL);