summaryrefslogtreecommitdiff
path: root/widget
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2022-10-24 23:47:42 -0500
committerBrian Smith <brian@dbsoft.org>2022-10-24 23:47:42 -0500
commit7a82ec5764d0e266dfabd376d2f646286a86156b (patch)
treecb0ab063e85ff20819c4d80471b96e0aa57497f6 /widget
parente73a2fb0fc21de86db411a1a0fd475582455c5ac (diff)
downloaduxp-7a82ec5764d0e266dfabd376d2f646286a86156b.tar.gz
Issue #2022 - Part 2 - Add Ventura version detection.
Also add Monterey and Ventura to the graphics driver blocklist.
Diffstat (limited to 'widget')
-rw-r--r--widget/GfxDriverInfo.h2
-rw-r--r--widget/GfxInfoBase.cpp4
-rw-r--r--widget/cocoa/GfxInfo.mm12
-rw-r--r--widget/cocoa/nsCocoaFeatures.h1
-rw-r--r--widget/cocoa/nsCocoaFeatures.mm13
5 files changed, 24 insertions, 8 deletions
diff --git a/widget/GfxDriverInfo.h b/widget/GfxDriverInfo.h
index 17baf136d7..119976bcbc 100644
--- a/widget/GfxDriverInfo.h
+++ b/widget/GfxDriverInfo.h
@@ -63,6 +63,8 @@ enum class OperatingSystem {
OSX10_15,
OSX10_16,
OSX11_0,
+ OSX12_0,
+ OSX13_0,
Ios
};
diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp
index ed47355367..242e41d5dc 100644
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -282,6 +282,10 @@ BlacklistOSToOperatingSystem(const nsAString& os)
return OperatingSystem::OSX10_15;
else if (os.EqualsLiteral("Darwin 20"))
return OperatingSystem::OSX11_0;
+ else if (os.EqualsLiteral("Darwin 21"))
+ return OperatingSystem::OSX12_0;
+ else if (os.EqualsLiteral("Darwin 22"))
+ return OperatingSystem::OSX13_0;
// For historical reasons, "All" in blocklist means "All Windows"
else if (os.EqualsLiteral("All"))
return OperatingSystem::Windows;
diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm
index 97bb4c8324..8e7edc1967 100644
--- a/widget/cocoa/GfxInfo.mm
+++ b/widget/cocoa/GfxInfo.mm
@@ -63,12 +63,12 @@ OSXVersionToOperatingSystem(uint32_t aOSXVersion) {
}
break;
case 11:
- switch (nsCocoaFeatures::ExtractMinorVersion(aOSXVersion)) {
- case 0:
- return OperatingSystem::OSX11_0;
- default:
- break;
- }
+ return OperatingSystem::OSX11_0;
+ case 12:
+ return OperatingSystem::OSX12_0;
+ case 13:
+ return OperatingSystem::OSX13_0;
+ default:
break;
}
diff --git a/widget/cocoa/nsCocoaFeatures.h b/widget/cocoa/nsCocoaFeatures.h
index c6841a7491..28ad617387 100644
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -26,6 +26,7 @@ public:
static bool OnCatalinaOrLater();
static bool OnBigSurOrLater();
static bool OnMontereyOrLater();
+ static bool OnVenturaOrLater();
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
diff --git a/widget/cocoa/nsCocoaFeatures.mm b/widget/cocoa/nsCocoaFeatures.mm
index 2edb958931..fdfdf1023f 100644
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -27,6 +27,7 @@
#define MACOS_VERSION_10_16_HEX 0x000A1000
#define MACOS_VERSION_11_0_HEX 0x000B0000
#define MACOS_VERSION_12_0_HEX 0x000C0000
+#define MACOS_VERSION_13_0_HEX 0x000D0000
#include "nsCocoaFeatures.h"
#include "nsCocoaUtils.h"
@@ -212,7 +213,8 @@ nsCocoaFeatures::OnBigSurOrLater()
(macOSVersion() >= MACOS_VERSION_11_0_HEX));
}
-/* static */ bool nsCocoaFeatures::OnMontereyOrLater()
+/* static */ bool
+nsCocoaFeatures::OnMontereyOrLater()
{
// Monterey pretends to be 10.16 and is indistinguishable from Big Sur.
// In practice, this means that an Intel build can return false
@@ -222,6 +224,12 @@ nsCocoaFeatures::OnBigSurOrLater()
}
/* static */ bool
+nsCocoaFeatures::OnVenturaOrLater()
+{
+ return (macOSVersion() >= MACOS_VERSION_13_0_HEX);
+}
+
+/* static */ bool
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
{
return macOSVersion() >= GetVersion(aMajor, aMinor, aBugFix);
@@ -234,7 +242,8 @@ nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFi
* for this purpose. Note: using this in a sandboxed process requires allowing
* the sysctl in the sandbox policy.
*/
-/* static */ bool nsCocoaFeatures::ProcessIsRosettaTranslated()
+/* static */ bool
+nsCocoaFeatures::ProcessIsRosettaTranslated()
{
int ret = 0;
size_t size = sizeof(ret);