chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.27k stars 456 forks source link

Direct Interaction with Views in Inactive Windows on macOS #3680

Closed nik-sp closed 5 months ago

nik-sp commented 5 months ago

Is your feature request related to a problem? Please describe. Currently, on macOS, users need to first activate a window by clicking on its title bar or content area before they can interact with specific views within that window. This process can be cumbersome and interrupts workflow efficiency, especially when users want to directly interact with a view in an inactive window.

Describe the solution you'd like I would like to request the addition of support that allows users to click on a view within an inactive window to directly activate that view, eliminating the need for a separate click to activate the entire window. This enhancement would streamline user interaction and improve overall user experience on macOS.

Describe alternatives you've considered One alternative is to continue with the current behavior, requiring users to first activate the window before interacting with views within it. However, this approach may lead to frustration and inefficiency, especially in scenarios where users frequently switch between multiple windows and views.

Additional context This feature enhancement would greatly benefit users who work with multiple windows and need to quickly access and interact with specific views without the extra step of activating the entire window first. It would enhance productivity and user satisfaction on the macOS platform.

Relevant macOS documentation: https://developer.apple.com/documentation/appkit/nsview/1483410-acceptsfirstmouse?language=objc

magreenblatt commented 5 months ago

For future reference:

I think we’re bypassing the preferred way of handling delegation here. The preferred way appears to be:

ContentBrowserClient::GetWebContentsViewDelegate (example) → WebContentsViewDelegate::GetDelegateForHost (example) → RenderWidgetHostViewMacDelegate (example) → Handle new signal.

In render_widget_host_view_cocoa.mm (example), call:

if (_responderDelegate && [_responderDelegate respondsToSelector:@selector(newSignal:)]) {
  [_responderDelegate newSignal];
}

Note that I’m not suggesting we implement this (due to all of the Chromium code changes), just pointing it out.