mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.2 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 ccfac3b103824..4497a134b2b7c 100644
 | |
| --- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
 | |
| +++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
 | |
| @@ -171,6 +171,13 @@ void ExtractUnderlines(NSAttributedString* string,
 | |
|  
 | |
|  // RenderWidgetHostViewCocoa ---------------------------------------------------
 | |
|  
 | |
| +@interface NSWindow (CefCustomMethods)
 | |
| +- (int)acceptsFirstMouse;
 | |
| +@end
 | |
| +
 | |
| +constexpr int kStateEnabled = 1;
 | |
| +constexpr int kStateDisabled = 2;
 | |
| +
 | |
|  // Private methods:
 | |
|  @interface RenderWidgetHostViewCocoa ()
 | |
|  
 | |
| @@ -789,6 +796,15 @@ void ExtractUnderlines(NSAttributedString* string,
 | |
|  }
 | |
|  
 | |
|  - (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] > kAcceptMouseEventsInActiveWindow;
 | |
|  }
 |