CefWindowDelegate::IsFrameless doesn't work

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefWindowDelegate::IsFrameless doesn't work

Postby ckr » Fri Dec 01, 2023 3:42 am

Hello,
I'm developing a CEF-Based app on macOS.
I use the "--use-views" switch to make sure the browser window was created with the "CEF Browser View" way.
Below are several key points about my program.
Code: Select all
class WindowDelegate : public CefWindowDelegate
{
public:
    // omit the Constructor and other methods...
   
    bool IsFrameless(CefRefPtr<CefWindow> window) override;
    void OnWindowCreated(CefRefPtr<CefWindow> window) override;
    void OnWindowDestroyed(CefRefPtr<CefWindow> window) override;
    bool CanClose(CefRefPtr<CefWindow> window) override;
    CefRect GetInitialBounds(CefRefPtr<CefWindow> window) override;

private:
    CefRefPtr<CefBrowserView> browserView;
    IMPLEMENT_REFCOUNTING(WindowDelegate);
};


Code: Select all
void WindowDelegate::OnWindowCreated(CefRefPtr<CefWindow> window) {
    window->AddChildView(browserView);
    window->Show();
    browserView->RequestFocus();
}

bool WindowDelegate::IsFrameless(CefRefPtr<CefWindow> window) {
    return true;
}


Code: Select all
    if (use_views) {
        CefRefPtr<PageHandler> pageHandler(new PageHandler());
        CefRefPtr<ViewDelegate> viewDelegate(new ViewDelegate());
        // Create the BrowserView.
        CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
                                                                                   pageHandler, url, browser_settings, nullptr, nullptr,
                                                                                   viewDelegate);
       
        // Create the Window. It will show itself after creation.
        CefWindow::CreateTopLevelWindow(new WindowDelegate(browser_view));
    }


In my code, IsFrameless method always returns true. But the app displays a title bar. Why?
ckr
Newbie
 
Posts: 5
Joined: Tue Nov 21, 2023 3:20 am

Re: CefWindowDelegate::IsFrameless doesn't work

Postby ckr » Mon Dec 11, 2023 1:40 am

For this issue, I'm still completely puzzled at the moment. Can someone help me, please?
ckr
Newbie
 
Posts: 5
Joined: Tue Nov 21, 2023 3:20 am

Re: CefWindowDelegate::IsFrameless doesn't work

Postby magreenblatt » Mon Dec 11, 2023 11:59 am

What MacOS and CEF version? Is your WindowDelegate::IsFrameless method getting called? Does "cefclient --use-views --hide-frame" work for you?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CefWindowDelegate::IsFrameless doesn't work

Postby ckr » Wed Dec 13, 2023 4:43 am

magreenblatt wrote:What MacOS and CEF version? Is your WindowDelegate::IsFrameless method getting called? Does "cefclient --use-views --hide-frame" work for you?

1. MacOS 13.5.2 CEF 94.4.10
2. WindowDelegate::IsFrameless is getting called。I set a breakpoint in this method, and the program paused at that location.
3. "cefclient --use-views --hide-frame" also shows the title bar.
ckr
Newbie
 
Posts: 5
Joined: Tue Nov 21, 2023 3:20 am

Re: CefWindowDelegate::IsFrameless doesn't work

Postby magreenblatt » Wed Dec 13, 2023 10:12 am

CEF 94.4.10

This version is too old. You will need 113 or newer. See https://github.com/chromiumembedded/cef/issues/3189
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 225 guests