You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the window.close() method in the cefclient application on macOS with the --hide-window-on-close flag enabled, the application breaks. The page is rendered white, it's impossible to close the application.
To Reproduce
Steps to reproduce the behavior:
Launch the cefclient application with the --hide-window-on-close flag enabled.
Navigate within the application to a webpage where window.close() is invoked.
Invoke window.close() programmatically or through an action in the webpage.
Notice that the window is close, but the app still present in the dock
Expected behavior
The application should gracefully close the window or hide it according to the --hide-window-on-close flag setting, without breaking or exhibiting unexpected behavior when window.close() is invoked.
Screenshots
With hidden frame
Versions (please complete the following information):
OS: MacOS 14.3.1
CEF Version: 121, 122 and latest main
Additional context
It seems that CloseWithReason exits prematurely because OnWindowCloseRequested returns CloseRequestResult::kCannotClose. As a result, the application ends up in an invalid partially closed state.
voidWidget::CloseWithReason(ClosedReason closed_reason) {
if (widget_closed_) {
// It appears we can hit this code path if you close a modal dialog then// close the last browser before the destructor is hit, which triggers// invoking Close again.return;
}
if (block_close_) {
return;
}
if (non_client_view_ && non_client_view_->OnWindowCloseRequested() ==
CloseRequestResult::kCannotClose) {
return;
}
The text was updated successfully, but these errors were encountered:
magreenblatt
changed the title
window.close() breaks the cefclient when --hide-on-close is enabled on macOS
mac: window.close() breaks the cefclient with --hide-window-on-closeMar 6, 2024
Description
When using the window.close() method in the cefclient application on macOS with the --hide-window-on-close flag enabled, the application breaks. The page is rendered white, it's impossible to close the application.
To Reproduce
Steps to reproduce the behavior:
--hide-window-on-close
flag enabled.Expected behavior
The application should gracefully close the window or hide it according to the --hide-window-on-close flag setting, without breaking or exhibiting unexpected behavior when window.close() is invoked.
Screenshots
With hidden frame
Versions (please complete the following information):
Additional context
It seems that
CloseWithReason
exits prematurely becauseOnWindowCloseRequested
returnsCloseRequestResult::kCannotClose
. As a result, the application ends up in an invalid partially closed state.The text was updated successfully, but these errors were encountered: