alloy: mac: Fix default popup window positioning (see issue #3244)

Popup windows will be created on the display that best matches the requested
coordinates. The requested size will apply to the content area (as required by
JS documentation) and window size will be reduced if necessary to fit within the
target display. The requested origin will apply to the window (including frame)
and will be modified if necessary so that the window is fully visible on the
target display.

This change does not implement popup positioning for cefclient which uses an
application-created parent window.

This change grants access to the getScreenDetails JS API without user prompt.
This commit is contained in:
Nik Pavlov
2022-06-27 10:29:16 +00:00
committed by Marshall Greenblatt
parent 1ca4961b27
commit d3a2237a5a
11 changed files with 424 additions and 27 deletions

View File

@ -154,7 +154,6 @@ bool CefBrowserInfoManager::CanCreateWindow(
CefPopupFeatures cef_features;
TranslatePopupFeatures(features, cef_features);
#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC))
// Default to the size from the popup features.
if (cef_features.xSet)
window_info.bounds.x = cef_features.x;
@ -164,7 +163,6 @@ bool CefBrowserInfoManager::CanCreateWindow(
window_info.bounds.width = cef_features.width;
if (cef_features.heightSet)
window_info.bounds.height = cef_features.height;
#endif
allow = !handler->OnBeforePopup(
browser.get(), opener_frame, pending_popup->target_url.spec(),