views: mac: Add CEF_SHOW_STATE_HIDDEN (fixes #3630)

- Adds `--initial-show-state=hidden` support for cefclient and cefsimple
  where the window launches as initially hidden (no dock thumbnail).
- Adds `--hide-window-on-close` support for cefclient where clicking the
  red traffic light button hides the window instead of closing it.
This commit is contained in:
Marshall Greenblatt
2024-01-29 13:38:25 -05:00
parent 47fe9f834a
commit 57bad703ee
18 changed files with 320 additions and 42 deletions

View File

@@ -14,7 +14,7 @@ class SimpleHandler : public CefClient,
public CefLifeSpanHandler,
public CefLoadHandler {
public:
explicit SimpleHandler(bool use_views);
SimpleHandler();
~SimpleHandler() override;
// Provide access to the single global instance of this object.
@@ -41,6 +41,8 @@ class SimpleHandler : public CefClient,
const CefString& errorText,
const CefString& failedUrl) override;
void ShowMainWindow();
// Request that all existing browser windows close.
void CloseAllBrowsers(bool force_close);
@@ -53,9 +55,7 @@ class SimpleHandler : public CefClient,
// Platform-specific implementation.
void PlatformTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title);
// True if the application is using the Views framework.
const bool use_views_;
void PlatformShowWindow(CefRefPtr<CefBrowser> browser);
// List of existing browser windows. Only accessed on the CEF UI thread.
typedef std::list<CefRefPtr<CefBrowser>> BrowserList;