mirror of
https://github.com/aphrody-labs/cef.git
synced 2026-10-13 21:07:07 +00:00
- Windows SDK 10.0.28000.2270 is now required - CefRegisterExtension is deprecated due to https://crbug.com/40347662
35 lines
1.3 KiB
Diff
35 lines
1.3 KiB
Diff
diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
|
index 6a2880e6e561d340b4bafacd7d70fe3493fbba40..10bf1484d6fd019f93438d7bf69c9762fa31fd28 100644
|
|
--- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
|
+++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
|
@@ -193,6 +193,13 @@ void ExtractUnderlines(NSAttributedString* string,
|
|
|
|
// RenderWidgetHostViewCocoa ---------------------------------------------------
|
|
|
|
+@interface NSWindow (CefCustomMethods)
|
|
+- (int)acceptsFirstMouse;
|
|
+@end
|
|
+
|
|
+constexpr int kStateEnabled = 1;
|
|
+constexpr int kStateDisabled = 2;
|
|
+
|
|
// Private methods:
|
|
@interface RenderWidgetHostViewCocoa ()
|
|
|
|
@@ -852,6 +859,15 @@ static NSWindow* __weak _deferredResignKeyWindow;
|
|
}
|
|
|
|
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
|
|
+ if ([self.window respondsToSelector:@selector(acceptsFirstMouse)]) {
|
|
+ const auto mode = [self.window acceptsFirstMouse];
|
|
+ if (mode == kStateEnabled) {
|
|
+ return YES;
|
|
+ } else if (mode == kStateDisabled) {
|
|
+ return NO;
|
|
+ }
|
|
+ }
|
|
+
|
|
// Enable "click-through" if mouse clicks are accepted in inactive windows.
|
|
return
|
|
[self acceptsMouseEventsOption] > AcceptMouseEvents::kWhenInActiveWindow;
|