PopupMenu::show doesn't work in OpenGL/kiosk mode - reproduced in juce demo

I'm going full-screen by calling setKioskModeComponent and passing my DocumentWindow.

Unfortunately, then my right-click menu doesn't work (PopupMenu::show is still called).

Anyone else encounter this?


Edit: see reply below.

I can reproduce this bug in the juce demo. I'm running Windows 8.1 / Visual C++ Express 2013. Using latest JUCE version (just updated now to eed0a41a4f). Repro steps:


1. Select Components: Tabs & Widgets in left column

2. Under "Look-and-feel" select "Use OpenGL Renderer"

3. Under "Look-and-feel" select "Show full-screen kiosk mode"

4. Click on "Show Popup Menu"

5. Observe: menu is not displayed


All is well when using the software renderer. As a work-around for my app: can I use the software renderer in a window with an OpenGL context?

This is really odd.. I can't reproduce this in Win7, and don't have a Win8 machine handy to test with. And I can't really see why the rendering mode would make any difference, since the tooltip's in a completely separate window. Got any other clues?

Doing a quick alt-tab shows that the popup is behind the window.

Oops, I forgot to subscribe and didn't see your reply. Where should I start looking for clues? I'm not very familiar with the JUCE codebase or how Windows manages graphics contexts (and their ordering), but I'm happy to help try to fix this one as my users are requesting a full-screen mode.

Here's a clue: when I comment out this call to setUsingNativeTitleBar in juce_win32_Windowing.cpp, the problem goes away:

void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool /*allowMenusAndBars*/)
    //if (TopLevelWindow* tlw = dynamic_cast<TopLevelWindow*> (kioskModeComponent))
    //    tlw->setUsingNativeTitleBar (! enableOrDisable);

    if (enableOrDisable)
        kioskModeComponent->setBounds (getDisplays().getMainDisplay().totalArea);

Does that help?

It does work for me in Windows 10
It is useful for keeping titlebar when restore window.

Put this answer in a different thread but if anyone is still running into this issue:

Fixed it by passing in “withParentComponent” Options when showing the PopupMenu.

Where top_level is my top parent OpenGLRenderer object.