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

@ -0,0 +1,17 @@
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_SCREEN_UTIL_H_
#define CEF_LIBCEF_BROWSER_SCREEN_UTIL_H_
#pragma once
#include "include/internal/cef_types_wrappers.h"
// Create a new rectangle from the input |rect| rectangle that is fully visible
// on provided |screen_rect| screen. The width and height of the resulting
// rectangle are clamped to the screen width and height respectively if they
// would overflow.
CefRect MakeVisibleOnScreenRect(const CefRect& rect, const CefRect& screen);
#endif // CEF_LIBCEF_BROWSER_SCREEN_UTIL_H_