From f38c2b8fd23c84658ace57c88c77d0194ae193b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E5=AE=87=E8=88=AA?= Date: Fri, 2 Feb 2018 21:35:35 +0800 Subject: [PATCH] Fix issues/65 Fix issue 65: scan QR from screen requires independent GPU. https://github.com/qinyuhang/ShadowsocksX-NG-R/issues/65 --- ShadowsocksX-NG/Utils.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowsocksX-NG/Utils.m b/ShadowsocksX-NG/Utils.m index d412ad3..c7922a8 100644 --- a/ShadowsocksX-NG/Utils.m +++ b/ShadowsocksX-NG/Utils.m @@ -45,7 +45,7 @@ void ScanQRCodeOnScreen() { NSMutableArray* foundSSUrls = [NSMutableArray array]; CIDetector *detector = [CIDetector detectorOfType:@"CIDetectorTypeQRCode" - context:nil + context:[CIContext contextWithOptions:@{kCIContextUseSoftwareRenderer: @true}] options:@{ CIDetectorAccuracy:CIDetectorAccuracyHigh }]; for (unsigned int displaysIndex = 0; displaysIndex < dspCount; displaysIndex++) @@ -66,7 +66,7 @@ void ScanQRCodeOnScreen() { } free(displays); - + // TODO if not find any urls push a notification tells there is no QR on the screen [[NSNotificationCenter defaultCenter] postNotificationName:@"NOTIFY_FOUND_SS_URL" object:nil