views: mac: Fix frameless window behavior (fixes issue #3189)

Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
This commit is contained in:
Nik Pavlov
2023-02-28 18:34:12 +00:00
committed by Marshall Greenblatt
parent 42f351a40d
commit 276423dcfb
22 changed files with 579 additions and 57 deletions

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=18f601c8e152c39928595e1f02c9274f0dc6ce8a$
// $hash=40aea12873a3c8803c9d2d6c06a0270197ead58e$
//
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
@@ -257,6 +257,63 @@ bool CefWindowDelegateCToCpp::IsFrameless(CefRefPtr<CefWindow> window) {
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefWindowDelegateCToCpp::WithStandardWindowButtons(
CefRefPtr<CefWindow> window) {
shutdown_checker::AssertNotShutdown();
cef_window_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, with_standard_window_buttons)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: window; type: refptr_diff
DCHECK(window.get());
if (!window.get()) {
return false;
}
// Execute
int _retval = _struct->with_standard_window_buttons(
_struct, CefWindowCppToC::Wrap(window));
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefWindowDelegateCToCpp::GetTitlebarHeight(CefRefPtr<CefWindow> window,
float* titlebar_height) {
shutdown_checker::AssertNotShutdown();
cef_window_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_titlebar_height)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: window; type: refptr_diff
DCHECK(window.get());
if (!window.get()) {
return false;
}
// Verify param: titlebar_height; type: simple_byaddr
DCHECK(titlebar_height);
if (!titlebar_height) {
return false;
}
// Execute
int _retval = _struct->get_titlebar_height(
_struct, CefWindowCppToC::Wrap(window), titlebar_height);
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall")
bool CefWindowDelegateCToCpp::CanResize(CefRefPtr<CefWindow> window) {
shutdown_checker::AssertNotShutdown();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=1a923e68b1e07234f97d3c219cc70cc91c118a77$
// $hash=d100d8866a7eab2a163d4ddb3cacd00141f65757$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_
@@ -50,6 +50,9 @@ class CefWindowDelegateCToCpp
CefRect GetInitialBounds(CefRefPtr<CefWindow> window) override;
cef_show_state_t GetInitialShowState(CefRefPtr<CefWindow> window) override;
bool IsFrameless(CefRefPtr<CefWindow> window) override;
bool WithStandardWindowButtons(CefRefPtr<CefWindow> window) override;
bool GetTitlebarHeight(CefRefPtr<CefWindow> window,
float* titlebar_height) override;
bool CanResize(CefRefPtr<CefWindow> window) override;
bool CanMaximize(CefRefPtr<CefWindow> window) override;
bool CanMinimize(CefRefPtr<CefWindow> window) override;