NSView在窗口大小调整时闪烁

时间:2016-07-04 08:12:17

标签: objective-c nswindow flicker chromium-embedded window-resize

我已经为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窗口闪烁。 任何想法将不胜感激。谢谢!

0 个答案:

没有答案