Dropdown menus not appearing in rev 3202

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.

Dropdown menus not appearing in rev 3202

Postby callum » Wed Dec 20, 2017 2:11 pm

Updating the version of CEF my Windows 64bit app builds againt from 2526 to 3202 and noticed dropdown menus don't work anymore. They do work in cefclient with offscreen rendering disabled so the problem is in my code.

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!
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Re: Dropdown menus not appearing in rev 3202

Postby magreenblatt » Wed Dec 20, 2017 3:56 pm

You should verify that you're sending mouse events correctly. It sounds like you may be dismissing the popup.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Dropdown menus not appearing in rev 3202

Postby callum » Wed Dec 20, 2017 4:56 pm

Interesting. I can see how that might be responsible. The code there hasn't changed for a long time but a good place to look. Thanks.
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Re: Dropdown menus not appearing in rev 3202

Postby callum » Wed Dec 20, 2017 6:26 pm

I checked my mouse event injection code and it seems correct. Moreover, editing the mouse event code in cefclient and making it the same as mine still resulted in the popup working normally there.

I think it must be an issue somewhere else in my code.
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Re: Dropdown menus not appearing in rev 3202

Postby Czarek » Thu Dec 21, 2017 4:02 am

Make sure you're sending mouse events exactly as in cefclient. Print out all mouse events in cefclient and print them in your app and compare - including all modifiers etc.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Dropdown menus not appearing in rev 3202

Postby callum » Thu Dec 21, 2017 11:52 am

I'm fairly sure and I modified cefclient to send mouse events the same way I do and it continued to work as expected.
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Re: Dropdown menus not appearing in rev 3202

Postby magreenblatt » Thu Dec 21, 2017 11:55 am

It could also be focus related. If you have the debugger attached then breaking to the debugger will change the focus and potentially dismiss the menu.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Dropdown menus not appearing in rev 3202

Postby callum » Thu Dec 21, 2017 11:59 am

Yep, yep - I considered that too. Also using OutputDebugStringA() and a tool from (what was) SysInternals to catch the output.
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Re: Dropdown menus not appearing in rev 3202

Postby Czarek » Fri Dec 22, 2017 7:50 am

Try creating a minimal example that reproduces it.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Dropdown menus not appearing in rev 3202

Postby callum » Fri Dec 22, 2017 7:14 pm

Yep. I have a non-gui minimal example that I can add mouse injection events and see if I can repro what I see - I'll post here when I get it working.
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 39 guests