我已经为cef3的NSWindow实现了一个调整大小的方法:
void ClientHandler::setWindowRect(int left, int top, int right, int bottom)
{
if(!CefCurrentlyOn(TID_UI))
{
// Execute on the UI thread.
CefPostTask(TID_UI,
base::Bind(&ClientHandler::setWindowRect, this, left, top, right, bottom));
return;
}
NSView* view = (NSView*) GetBrowser()->GetHost()->GetWindowHandle();
NSWindow* window = [view window];
NSRect winRect = NSMakeRect(left, top, right - left, bottom - top);
[window setFrame:winRect display:NO];
}
我经常调用这个方法,它会导致cef窗口闪烁。 任何想法将不胜感激。谢谢!