From 9ce7264889e36fddbdf6bac332225ad6f628ad5d Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sun, 26 Jun 2022 10:31:54 -0700
Subject: [PATCH] XQuartz: Add TCC reason keys to Info.plist

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 hw/xquartz/bundle/Info.plist.cpp | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index 323dec2051..7cb59ea77c 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -28,6 +28,31 @@
 		<true/>
 	<key>NSSupportsAutomaticGraphicsSwitching</key>
 		<true/>
+
+	<!-- Add generic usage descriptions for TCC
+	     https://github.com/XQuartz/XQuartz/issues/245
+	  -->
+	<key>NSAppleEventsUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants to use AppleScript.</string>
+	<key>NSCalendarsUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your calendar data.</string>
+	<key>NSCameraUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your camera.</string>
+	<key>NSContactsUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your contacts.</string>
+	<key>NSLocationAlwaysUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your location information, even when not in use.</string>
+	<key>NSLocationUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your location information.</string>
+	<key>NSLocationWhenInUseUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your location information when in use.</string>
+	<key>NSMicrophoneUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your microphone.</string>
+	<key>NSRemindersUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants access to your reminders.</string>
+	<key>NSSystemAdministrationUsageDescription</key>
+	<string>A process launched by APPLE_APPLICATION_NAME wants admin privileges.</string>
+
 #ifdef XQUARTZ_SPARKLE
 	<key>SUEnableAutomaticChecks</key>
 		<true/>
-- 
GitLab