From a892fa9e33d9c91db40af2952076b67154bed9bc Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 30 Mar 2015 23:53:52 -0700 Subject: [PATCH] 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. --- plugins/mac-capture/mac-display-capture.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/mac-capture/mac-display-capture.m b/plugins/mac-capture/mac-display-capture.m index 92227b1d0..dd8bdb55c 100644 --- a/plugins/mac-capture/mac-display-capture.m +++ b/plugins/mac-capture/mac-display-capture.m @@ -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);