build: simplify mas patches (#36368)

* build: simplify mas patches

* build: re-add configs
This commit is contained in:
Samuel Attard 2023-11-21 10:53:21 -08:00 committed by GitHub
parent 3d2a754531
commit dbe170c665
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1667 additions and 1806 deletions

View file

@ -7,10 +7,8 @@ This allows Electron to override `acceptsFirstMouse` on Mac so that windows can
respond to the first mouse click in their window, which is desirable for some
kinds of utility windows. Similarly for `disableAutoHideCursor`.
Additionally, disables usage of some private APIs in MAS builds.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 81f705328efd2de0957c1ef309e20c421e0959eb..d6f9998890d7a83a8fb221691aa2f1e761461d52 100644
index 81f705328efd2de0957c1ef309e20c421e0959eb..47afd2553bf76b5b185a4be131196d90cf9cad44 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -158,6 +158,15 @@ void ExtractUnderlines(NSAttributedString* string,
@ -61,25 +59,3 @@ index 81f705328efd2de0957c1ef309e20c421e0959eb..d6f9998890d7a83a8fb221691aa2f1e7
// We only handle key down events and just simply forward other events.
if (eventType != NSEventTypeKeyDown) {
_hostHelper->ForwardKeyboardEvent(event, latency_info);
@@ -1999,15 +2019,21 @@ - (NSAccessibilityRole)accessibilityRole {
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
+#if !IS_MAS_BUILD()
extern "C" {
extern NSString* NSTextInputReplacementRangeAttributeName;
}
+#endif
- (NSArray*)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
static NSArray* const kAttributes = @[
NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName,
+#if !IS_MAS_BUILD()
NSMarkedClauseSegmentAttributeName, NSTextInputReplacementRangeAttributeName
+#else
+ NSMarkedClauseSegmentAttributeName
+#endif
];
return kAttributes;
}