mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
5f18cf3bed
41 changed files with 234 additions and 485 deletions
|
|
@ -49,6 +49,23 @@ enum class OperatingSystem {
|
|||
Windows8_1,
|
||||
Windows10,
|
||||
Linux,
|
||||
OSX,
|
||||
OSX10_5,
|
||||
OSX10_6,
|
||||
OSX10_7,
|
||||
OSX10_8,
|
||||
OSX10_9,
|
||||
OSX10_10,
|
||||
OSX10_11,
|
||||
OSX10_12,
|
||||
OSX10_13,
|
||||
OSX10_14,
|
||||
OSX10_15,
|
||||
OSX10_16,
|
||||
OSX11_0,
|
||||
OSX12_0,
|
||||
OSX13_0,
|
||||
Ios
|
||||
};
|
||||
|
||||
enum VersionComparisonOp {
|
||||
|
|
|
|||
|
|
@ -264,6 +264,34 @@ BlacklistOSToOperatingSystem(const nsAString& os)
|
|||
return OperatingSystem::Windows10;
|
||||
else if (os.EqualsLiteral("Linux"))
|
||||
return OperatingSystem::Linux;
|
||||
else if (os.EqualsLiteral("Darwin 9"))
|
||||
return OperatingSystem::OSX10_5;
|
||||
else if (os.EqualsLiteral("Darwin 10"))
|
||||
return OperatingSystem::OSX10_6;
|
||||
else if (os.EqualsLiteral("Darwin 11"))
|
||||
return OperatingSystem::OSX10_7;
|
||||
else if (os.EqualsLiteral("Darwin 12"))
|
||||
return OperatingSystem::OSX10_8;
|
||||
else if (os.EqualsLiteral("Darwin 13"))
|
||||
return OperatingSystem::OSX10_9;
|
||||
else if (os.EqualsLiteral("Darwin 14"))
|
||||
return OperatingSystem::OSX10_10;
|
||||
else if (os.EqualsLiteral("Darwin 15"))
|
||||
return OperatingSystem::OSX10_11;
|
||||
else if (os.EqualsLiteral("Darwin 16"))
|
||||
return OperatingSystem::OSX10_12;
|
||||
else if (os.EqualsLiteral("Darwin 17"))
|
||||
return OperatingSystem::OSX10_13;
|
||||
else if (os.EqualsLiteral("Darwin 18"))
|
||||
return OperatingSystem::OSX10_14;
|
||||
else if (os.EqualsLiteral("Darwin 19"))
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ namespace widget {
|
|||
*****************************************************************************/
|
||||
|
||||
bool TextEventDispatcher::sDispatchKeyEventsDuringComposition = false;
|
||||
bool TextEventDispatcher::sDispatchKeyPressEventNonPrintableInContent = false;
|
||||
|
||||
TextEventDispatcher::TextEventDispatcher(nsIWidget* aWidget)
|
||||
: mWidget(aWidget)
|
||||
|
|
@ -36,6 +37,10 @@ TextEventDispatcher::TextEventDispatcher(nsIWidget* aWidget)
|
|||
&sDispatchKeyEventsDuringComposition,
|
||||
"dom.keyboardevent.dispatch_during_composition",
|
||||
false);
|
||||
Preferences::AddBoolVarCache(
|
||||
&sDispatchKeyPressEventNonPrintableInContent,
|
||||
"dom.keyboardevent.keypress.dispatch_non_printable_in_content",
|
||||
false);
|
||||
sInitialized = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -531,6 +536,13 @@ TextEventDispatcher::DispatchKeyboardEventInternal(
|
|||
}
|
||||
}
|
||||
|
||||
if (!sDispatchKeyPressEventNonPrintableInContent &&
|
||||
keyEvent.mMessage == eKeyPress &&
|
||||
!keyEvent.IsInputtingText() &&
|
||||
!keyEvent.IsInputtingLineBreak()) {
|
||||
keyEvent.mFlags.mOnlySystemGroupDispatchInContent = true;
|
||||
}
|
||||
|
||||
DispatchInputEvent(mWidget, keyEvent, aStatus);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -399,6 +399,10 @@ private:
|
|||
// is a composition.
|
||||
static bool sDispatchKeyEventsDuringComposition;
|
||||
|
||||
// If this is true, keypress events for non-printable keys are dispatched to
|
||||
// event listeners of the system event group in web content.
|
||||
static bool sDispatchKeyPressEventNonPrintableInContent;
|
||||
|
||||
nsresult BeginInputTransactionInternal(
|
||||
TextEventDispatcherListener* aListener,
|
||||
InputTransactionType aType);
|
||||
|
|
|
|||
|
|
@ -183,6 +183,30 @@ public:
|
|||
return IsKeyEventOnPlugin(mMessage);
|
||||
}
|
||||
|
||||
bool IsInputtingText() const
|
||||
{
|
||||
// NOTE: On some keyboard layouts, some characters are put in with Control
|
||||
// or Alt keys, but at that time, widget unsets the modifier flag
|
||||
// from the eKeyPress event, so it does not count as a modifier in
|
||||
// this check.
|
||||
return mMessage == eKeyPress &&
|
||||
mCharCode &&
|
||||
!(mModifiers & (MODIFIER_ALT |
|
||||
MODIFIER_CONTROL |
|
||||
MODIFIER_META |
|
||||
MODIFIER_OS));
|
||||
}
|
||||
|
||||
bool IsInputtingLineBreak() const
|
||||
{
|
||||
return mMessage == eKeyPress &&
|
||||
mKeyNameIndex == KEY_NAME_INDEX_Enter &&
|
||||
!(mModifiers & (MODIFIER_ALT |
|
||||
MODIFIER_CONTROL |
|
||||
MODIFIER_META |
|
||||
MODIFIER_OS));
|
||||
}
|
||||
|
||||
virtual WidgetEvent* Duplicate() const override
|
||||
{
|
||||
MOZ_ASSERT(mClass == eKeyboardEventClass,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -221,6 +223,12 @@ nsCocoaFeatures::OnBigSurOrLater()
|
|||
return (macOSVersion() >= MACOS_VERSION_12_0_HEX);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCocoaFeatures::OnVenturaOrLater()
|
||||
{
|
||||
return (macOSVersion() >= MACOS_VERSION_13_0_HEX);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t 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);
|
||||
|
|
|
|||
|
|
@ -2903,6 +2903,10 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil;
|
|||
{
|
||||
mDrawsIntoWindowFrame = NO;
|
||||
[super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];
|
||||
// MacOS 13 Ventura, doesn't seem to create the contentView... so create it ourselves
|
||||
if(![super contentView]) {
|
||||
[super setContentView:[[NSView alloc] initWithFrame:aContentRect]];
|
||||
}
|
||||
mState = nil;
|
||||
mActiveTitlebarColor = nil;
|
||||
mInactiveTitlebarColor = nil;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue