Repaint CEF Window

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.

Repaint CEF Window

Postby t1teddypark » Thu Nov 19, 2020 1:00 pm

I want to make make a transition between a unresizable window and resizable window when my CEF client hit certain webpages.
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?
t1teddypark
Newbie
 
Posts: 4
Joined: Thu Nov 19, 2020 12:44 pm

Return to Support Forum

Who is online

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