79 lines
3.3 KiB
Diff
79 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:46:28 -0700
|
|
Subject: render_widget_host_view_mac.patch
|
|
|
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_cocoa.mm b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
|
|
index d04130dcb387a985c57fd0d94c10a8c327afe6f3..8d2ed9af59a8e9bbd242ab098cba7f75fc1e6a3e 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_cocoa.mm
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
|
|
@@ -142,6 +142,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
|
|
|
} // namespace
|
|
|
|
+@interface NSWindow (AtomCustomMethods)
|
|
+- (BOOL)acceptsFirstMouse;
|
|
+- (BOOL)disableAutoHideCursor;
|
|
+@end
|
|
+
|
|
// These are not documented, so use only after checking -respondsToSelector:.
|
|
@interface NSApplication (UndocumentedSpeechMethods)
|
|
- (void)speakString:(NSString*)string;
|
|
@@ -403,6 +408,9 @@ void ExtractUnderlines(NSAttributedString* string,
|
|
}
|
|
|
|
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
|
|
+ if ([self.window respondsToSelector:@selector(acceptsFirstMouse)] &&
|
|
+ [self.window acceptsFirstMouse])
|
|
+ return YES;
|
|
return [self acceptsMouseEventsWhenInactive];
|
|
}
|
|
|
|
@@ -786,6 +794,10 @@ void ExtractUnderlines(NSAttributedString* string,
|
|
eventType == NSKeyDown &&
|
|
!(modifierFlags & NSCommandKeyMask);
|
|
|
|
+ if ([theEvent.window respondsToSelector:@selector(disableAutoHideCursor)] &&
|
|
+ [theEvent.window disableAutoHideCursor])
|
|
+ shouldAutohideCursor = NO;
|
|
+
|
|
// We only handle key down events and just simply forward other events.
|
|
if (eventType != NSKeyDown) {
|
|
clientHelper_->ForwardKeyboardEvent(event, latency_info);
|
|
@@ -1534,9 +1546,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
|
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
|
// make any key-typing jank. --hbono 7/23/09
|
|
//
|
|
+#ifndef MAS_BUILD
|
|
extern "C" {
|
|
extern NSString* NSTextInputReplacementRangeAttributeName;
|
|
}
|
|
+#endif
|
|
|
|
- (NSArray*)validAttributesForMarkedText {
|
|
// This code is just copied from WebKit except renaming variables.
|
|
@@ -1545,7 +1559,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
|
|
initWithObjects:NSUnderlineStyleAttributeName,
|
|
NSUnderlineColorAttributeName,
|
|
NSMarkedClauseSegmentAttributeName,
|
|
- NSTextInputReplacementRangeAttributeName, nil]);
|
|
+#ifndef MAS_BUILD
|
|
+ NSTextInputReplacementRangeAttributeName,
|
|
+#endif
|
|
+ nil]);
|
|
}
|
|
return validAttributesForMarkedText_.get();
|
|
}
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
index cb067c08a07b2fafb056f0d1cfa3d6b39c521a88..74d4ddbf24a2441a4eaafcde932ad67df9c7c913 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
@@ -61,6 +61,7 @@
|
|
#include "ui/events/keycodes/dom/dom_keyboard_layout_map.h"
|
|
#include "ui/gfx/geometry/dip_util.h"
|
|
#include "ui/gfx/mac/coordinate_conversion.h"
|
|
+#include "ui/gl/gpu_switching_manager.h"
|
|
|
|
using blink::WebInputEvent;
|
|
using blink::WebMouseEvent;
|