Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

views: mac: Fix frameless window behavior #3189

Closed
magreenblatt opened this issue Sep 23, 2021 · 10 comments
Closed

views: mac: Fix frameless window behavior #3189

magreenblatt opened this issue Sep 23, 2021 · 10 comments
Labels
bug Bug report Framework Related to framework code or APIs macos MacOS platform views Related to the Views framework

Comments

@magreenblatt
Copy link
Collaborator

Original report by me.


What steps will reproduce the problem?

Run cefclient.app/Contents/MacOS/cefclient --use-views --hide-frame --hide-controls

What is the expected output? What do you see instead?

The menu button and window controls should work the same as on Win/Linux. Instead:

  1. The window’s default title bar is still visible under the overlay controls (it should be hidden).
  2. The “maximize” button doesn’t work (Not implemented reached in virtual void views::NativeWidgetMac::Maximize, see issue views: mac: Add missing window functionality and fix tests #3188).
  3. Pressing the menu button causes a crash (we’ll need a way to identify the host view, similar to the kHostViewKey usage with Aura):
[0923/202523.505675:FATAL:view_util.cc(190)] Check failed: window. 
0   Chromium Embedded Framework         0x000000011f68fc1f base::debug::CollectStackTrace(void**, unsigned long) + 31
1   Chromium Embedded Framework         0x000000011f408c18 base::debug::StackTrace::StackTrace(unsigned long) + 72
2   Chromium Embedded Framework         0x000000011f408c9d base::debug::StackTrace::StackTrace(unsigned long) + 29
3   Chromium Embedded Framework         0x000000011f408c75 base::debug::StackTrace::StackTrace() + 37
4   Chromium Embedded Framework         0x000000011f44cb73 logging::LogMessage::~LogMessage() + 179
5   Chromium Embedded Framework         0x000000011f44da35 logging::LogMessage::~LogMessage() + 21
6   Chromium Embedded Framework         0x000000011f44da59 logging::LogMessage::~LogMessage() + 25
7   Chromium Embedded Framework         0x000000011f3e9ebb logging::CheckError::~CheckError() + 43
8   Chromium Embedded Framework         0x000000011f3e9995 logging::CheckError::~CheckError() + 21
9   Chromium Embedded Framework         0x000000011efde3c5 view_util::GetWindowFor(views::Widget*) + 421
10  Chromium Embedded Framework         0x000000011efc64db CefMenuButtonImpl::ShowMenu(scoped_refptr<CefMenuModel>, CefPoint const&, cef_menu_anchor_position_t) + 107
11  Chromium Embedded Framework         0x000000010fb03e96 (anonymous namespace)::menu_button_show_menu(_cef_menu_button_t*, _cef_menu_model_t*, _cef_point_t const*, cef_menu_anchor_position_t) + 662
12  cefclient                           0x000000010b2cde39 CefMenuButtonCToCpp::ShowMenu(scoped_refptr<CefMenuModel>, CefPoint const&, cef_menu_anchor_position_t) + 537
13  cefclient                           0x000000010b10a064 client::ViewsWindow::OnMenuButtonPressed(scoped_refptr<CefMenuButton>, CefPoint const&, scoped_refptr<CefMenuButtonPressedLock>) + 1476
14  cefclient                           0x000000010b2d2a95 (anonymous namespace)::menu_button_delegate_on_menu_button_pressed(_cef_menu_button_delegate_t*, _cef_menu_button_t*, _cef_point_t const*, _cef_menu_button_pressed_lock_t*) + 1013
15  Chromium Embedded Framework         0x000000010fb0acb1 CefMenuButtonDelegateCToCpp::OnMenuButtonPressed(scoped_refptr<CefMenuButton>, CefPoint const&, scoped_refptr<CefMenuButtonPressedLock>) + 577
16  Chromium Embedded Framework         0x000000011efcbfe7 CefMenuButtonView::ButtonPressed(ui::Event const&) + 183
17  Chromium Embedded Framework         0x000000011efce885 MenuButtonEx::MenuButtonEx()::'lambda'(MenuButtonEx*, ui::Event const&)::operator()(MenuButtonEx*, ui::Event const&) const + 37

What version of the product are you using? On what operating system?

Current CEF master (M95) on macOS Big Sur 11.3.1.

@magreenblatt
Copy link
Collaborator Author

  • edited description

1 similar comment
@magreenblatt
Copy link
Collaborator Author

  • edited description

@magreenblatt
Copy link
Collaborator Author

Related PR: https://bitbucket.org/chromiumembedded/cef/pull-requests/560

Includes screenshots of old/new behavior.

@magreenblatt
Copy link
Collaborator Author

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.

→ <<cset 276423dcfb2d (bb)>>

@magreenblatt
Copy link
Collaborator Author

  • changed state from "new" to "resolved"

@magreenblatt
Copy link
Collaborator Author

Remaining issues will be filed separately.

@magreenblatt
Copy link
Collaborator Author

views: mac: Show standard window buttons with frame by default (see issue #3189)

This restores the previous default behavior for framed windows.

→ <<cset 06af9c85da21 (bb)>>

@magreenblatt
Copy link
Collaborator Author

views: mac: Show standard window buttons with frame by default (see issue #3189)

This restores the previous default behavior for framed windows.

→ <<cset 798bc0e9cc02 (bb)>>

@magreenblatt
Copy link
Collaborator Author

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.

→ <<cset f6de0344cb7f (bb)>>

@magreenblatt
Copy link
Collaborator Author

views: mac: Show standard window buttons with frame by default (see issue #3189)

This restores the previous default behavior for framed windows.

→ <<cset 870da3087fcf (bb)>>

magreenblatt pushed a commit that referenced this issue Mar 16, 2023
This is intended for usage with frameless windows that show the standard window
buttons, where resizing the title bar height changes the button offset. Returning a
different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of
the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the
title bar height.

To test:
1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window`
2. Enter a new value for title bar height and click the "Set Titlebar Height" button
magreenblatt pushed a commit that referenced this issue Mar 16, 2023
This is intended for usage with frameless windows that show the standard window
buttons, where resizing the title bar height changes the button offset. Returning a
different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of
the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the
title bar height.

To test:
1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window`
2. Enter a new value for title bar height and click the "Set Titlebar Height" button
magreenblatt pushed a commit that referenced this issue Mar 16, 2023
This is intended for usage with frameless windows that show the standard window
buttons, where resizing the title bar height changes the button offset. Returning a
different value from CefWindowDelegate::GetTitlebarHeight and forcing a resize of
the NSWindow's theme frame (see ViewsWindow::NudgeWindow) will update the
title bar height.

To test:
1. Run `cefclient --use-views --hide-frame --show-window-buttons --url=http://tests/window`
2. Enter a new value for title bar height and click the "Set Titlebar Height" button
bb33bb pushed a commit to bb33bb/cef that referenced this issue Mar 18, 2023
…ed#3189)

Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
bb33bb pushed a commit to bb33bb/cef that referenced this issue Mar 18, 2023
…ssue chromiumembedded#3189)

This restores the previous default behavior for framed windows.
wjh-la pushed a commit to loongson/cef that referenced this issue Jun 29, 2023
…ed#3189)

Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
wjh-la pushed a commit to loongson/cef that referenced this issue Jun 29, 2023
…ssue chromiumembedded#3189)

This restores the previous default behavior for framed windows.
wjh-la pushed a commit to loongson/cef that referenced this issue Jun 29, 2023
…ssue chromiumembedded#3189)

This restores the previous default behavior for framed windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report Framework Related to framework code or APIs macos MacOS platform views Related to the Views framework
Projects
None yet
Development

No branches or pull requests

1 participant