Things I've tried:
It seems like I can't simply use the same CefWindowDelegate for these two cases. Just putting an if condition like the following does not work since the "CanResize" function is only called upon WindowCreation, and conditioning it at runtime doesn't do anything:
- Code: Select all
bool CanResize( CefRefPtr< CefWindow > window ) override {
if (is_resizable_frame){ // some variable that I can be manipulated outside of the CefWindowDelegate class
return false;
} else {
return true;
}
}
It seems like I have to destroy the window entirely and redraw a new window using functions like "CreateTopLevelWindow". So I try to do that via the following:
- Code: Select all
browser_view->GetWindow()->Close();
browser_view->GetWindow()->RemoveAllChildViews();
CefWindow::CreateTopLevelWindow(new SimpleWindowDelegate(browser_view_));
// essentially trying to take out the browser view, and attach it to a newly created window
But I get errors telling me that "single_thread_task_graph_runner.cc(39)] Check failed: !work_queue_.HasAnyNamespaces()" --- which I am not even sure what it means.
I wonder how can I properly destroy and redraw my CEF Top window?