Skip to content

Commit

Permalink
project: patch settings bundle for visionOS
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Sep 26, 2023
1 parent c6ddedc commit ea4906a
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Platform/Shared/VMConfigInputView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fileprivate enum UsbSupport: Int, Identifiable {
}
}

#if os(macOS)
#if os(macOS) || os(visionOS)
@available(macOS 11, *)
struct GestureSettingsSection: View {
var body: some View {
Expand Down
38 changes: 38 additions & 0 deletions Platform/iOS/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Gestures</string>
<key>Platform</key>
<string>iOS</string>
</dict>
<dict>
<key>Type</key>
Expand All @@ -169,6 +171,8 @@
<string>Long Press</string>
<key>Key</key>
<string>GestureLongPress</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>1</integer>
<key>Titles</key>
Expand All @@ -191,6 +195,8 @@
<string>Two Finger Tap</string>
<key>Key</key>
<string>GestureTwoTap</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>2</integer>
<key>Titles</key>
Expand All @@ -211,6 +217,8 @@
<string>Two Finger Pan</string>
<key>Key</key>
<string>GestureTwoPan</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>3</integer>
<key>Titles</key>
Expand All @@ -235,6 +243,8 @@
<string>Two Finger Swipe</string>
<key>Key</key>
<string>GestureTwoScroll</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>0</integer>
<key>Titles</key>
Expand All @@ -255,6 +265,8 @@
<string>Three Finger Pan</string>
<key>Key</key>
<string>GestureThreePan</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>0</integer>
<key>Titles</key>
Expand Down Expand Up @@ -285,6 +297,8 @@
<string>Touch Input</string>
<key>Key</key>
<string>MouseTouchType</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>0</integer>
<key>Titles</key>
Expand All @@ -300,13 +314,37 @@
<integer>2</integer>
</array>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Visibility</string>
<key>Key</key>
<string>MouseTouchType</string>
<key>Platform</key>
<string>xrOS</string>
<key>DefaultValue</key>
<integer>2</integer>
<key>Titles</key>
<array>
<string>Always show cursor</string>
<string>Try hiding cursor</string>
</array>
<key>Values</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Apple Pencil Input</string>
<key>Key</key>
<string>MousePencilType</string>
<key>Platform</key>
<string>iOS</string>
<key>DefaultValue</key>
<integer>2</integer>
<key>Titles</key>
Expand Down
47 changes: 47 additions & 0 deletions UTM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2553,6 +2553,7 @@
CE2D926924AD46670059923A /* Sources */,
CE2D932B24AD46670059923A /* Frameworks */,
CE2D936924AD46670059923A /* Resources */,
CE59A7B12ABCC75F00E5FFBD /* Patch Settings bundle */,
CE2D937524AD46670059923A /* Embed Libraries */,
);
buildRules = (
Expand Down Expand Up @@ -2632,6 +2633,7 @@
CEA45E24263519B5002FA97D /* Sources */,
CEA45F23263519B5002FA97D /* Frameworks */,
CEA45F63263519B5002FA97D /* Resources */,
CE59A7B22ABCCB7C00E5FFBD /* Patch Settings bundle */,
CEA45F71263519B5002FA97D /* Embed Libraries */,
);
buildRules = (
Expand Down Expand Up @@ -2823,6 +2825,51 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
CE59A7B12ABCC75F00E5FFBD /* Patch Settings bundle */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(SRCROOT)/Platform/iOS/Settings.bundle",
);
name = "Patch Settings bundle";
outputFileListPaths = (
);
outputPaths = (
"$(TARGET_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/Settings.bundle/Root.plist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\n\nPLISTBUDDY=/usr/libexec/PlistBuddy\nROOT_PLIST=\"$SCRIPT_OUTPUT_FILE_0\"\n\nCOUNT=$($PLISTBUDDY -c \"Print :PreferenceSpecifiers\" \"$ROOT_PLIST\" | grep -c '^ }$')\n\nfor ((i = 0; i < COUNT; i++)); do\n platform=$($PLISTBUDDY -c \"Print :PreferenceSpecifiers:$i:Platform\" \"$ROOT_PLIST\" 2> /dev/null)\n if [ ! -z \"$platform\" ]; then\n if [ \"$platform\" == \"$PLATFORM_FAMILY_NAME\" ]; then\n echo \"Found entry $i for $platform\"\n $PLISTBUDDY -c \"Delete :PreferenceSpecifiers:$i:Platform\" \"$ROOT_PLIST\"\n else\n echo \"Found entry $i for $platform, removing entry\"\n $PLISTBUDDY -c \"Delete :PreferenceSpecifiers:$i\" \"$ROOT_PLIST\"\n ((COUNT--))\n ((i--))\n fi\n fi\ndone\n";
showEnvVarsInLog = 0;
};
CE59A7B22ABCCB7C00E5FFBD /* Patch Settings bundle */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(SRCROOT)/Platform/iOS/Settings.bundle",
);
name = "Patch Settings bundle";
outputFileListPaths = (
);
outputPaths = (
"$(TARGET_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/Settings.bundle/Root.plist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\n\nPLISTBUDDY=/usr/libexec/PlistBuddy\nROOT_PLIST=\"$SCRIPT_OUTPUT_FILE_0\"\n\nCOUNT=$($PLISTBUDDY -c \"Print :PreferenceSpecifiers\" \"$ROOT_PLIST\" | grep -c '^ }$')\n\nfor ((i = 0; i < COUNT; i++)); do\n platform=$($PLISTBUDDY -c \"Print :PreferenceSpecifiers:$i:Platform\" \"$ROOT_PLIST\" 2> /dev/null)\n if [ ! -z \"$platform\" ]; then\n if [ \"$platform\" == \"$PLATFORM_FAMILY_NAME\" ]; then\n echo \"Found entry $i for $platform\"\n $PLISTBUDDY -c \"Delete :PreferenceSpecifiers:$i:Platform\" \"$ROOT_PLIST\"\n else\n echo \"Found entry $i for $platform, removing entry\"\n $PLISTBUDDY -c \"Delete :PreferenceSpecifiers:$i\" \"$ROOT_PLIST\"\n ((COUNT--))\n ((i--))\n fi\n fi\ndone\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
8401FD5E269BE9C500265F0D /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down

0 comments on commit ea4906a

Please sign in to comment.