2024-04-12 17:49:31 +02:00
|
|
|
diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
2024-05-23 03:52:35 +02:00
|
|
|
index 1cb6eb60ef419..b0bdc60cebc0d 100644
|
2024-04-12 17:49:31 +02:00
|
|
|
--- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
|
|
|
+++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
2024-05-23 03:52:35 +02:00
|
|
|
@@ -166,6 +166,13 @@ void ExtractUnderlines(NSAttributedString* string,
|
2024-04-23 22:06:00 +02:00
|
|
|
|
2024-04-12 17:49:31 +02:00
|
|
|
// RenderWidgetHostViewCocoa ---------------------------------------------------
|
2024-04-23 22:06:00 +02:00
|
|
|
|
2024-04-12 17:49:31 +02:00
|
|
|
+@interface NSWindow (CefCustomMethods)
|
|
|
|
+- (int)acceptsFirstMouse;
|
|
|
|
+@end
|
|
|
|
+
|
|
|
|
+constexpr int kStateEnabled = 1;
|
|
|
|
+constexpr int kStateDisabled = 2;
|
|
|
|
+
|
|
|
|
// Private methods:
|
|
|
|
@interface RenderWidgetHostViewCocoa ()
|
2024-04-23 22:06:00 +02:00
|
|
|
|
2024-05-23 03:52:35 +02:00
|
|
|
@@ -762,6 +769,15 @@ void ExtractUnderlines(NSAttributedString* string,
|
2024-04-12 17:49:31 +02:00
|
|
|
}
|
2024-04-23 22:06:00 +02:00
|
|
|
|
2024-04-12 17:49:31 +02:00
|
|
|
- (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;
|
|
|
|
+ }
|
|
|
|
+ }
|
2024-05-23 03:52:35 +02:00
|
|
|
+
|
|
|
|
// Enable "click-through" if mouse clicks are accepted in inactive windows
|
|
|
|
return [self acceptsMouseEventsOption] > kAcceptMouseEventsInActiveWindow;
|
2024-04-12 17:49:31 +02:00
|
|
|
}
|