I replaced my code with something similar to what's in the cefclient osr_window_win.cc. The main page draws properly but still no dropdowns. I noticed when I click on the dropdown, my onPopupShow() gets called as expected with show = true, onPopupSize() gets called with the correct size but then onPopupShow() is called again immediately with show = false. Consequently (i think) my OnPaint() is never called with type = PET_POPUP and the popup is never drawn.
- Code: Select all
void myClass::OnPaint(CefRefPtr<CefBrowser> browser,
CefRenderHandler::PaintElementType type,
const CefRenderHandler::RectList& dirtyRects,
const void* buffer,
int width,
int height)
{
if (painting_popup_)
{
myOnPaint(browser, type, dirtyRects, buffer, width, height);
return;
}
myOnPaint(browser, type, dirtyRects, buffer, width, height);
if (type == PET_VIEW && !renderer_.popup_rect().IsEmpty())
{
painting_popup_ = true;
browser->GetHost()->Invalidate(PET_POPUP);
painting_popup_ = false;
}
myRender();
}
I've been stepping through this for hours and can't see what I'm missing - can anyone suggest what might be happening and why I get OnPopupClose() straight away in the new code.
Thank you!