WebBrowserComponent inside a DialogWindow


#1

Hi.

When showing a DialogWindow with WebBrowserComponent as its content, the web browser is unclickable.
I’m using setContentNotOwned() and runModalLoop().
I can see the web page and its content, and the mouse icon even changes when hovering on links, but I can’t click on anything.

Thanks.


#2

Ok… does this change help, in juce_win32_Messaging.cpp

[code]static bool isHWNDBlockedByModalComponents (HWND h)
{
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;)
{
Component* const c = Desktop::getInstance().getComponent (i);

    if (c != nullptr 
          && (! c->isCurrentlyBlockedByAnotherModalComponent())
          && IsChild ((HWND) c->getWindowHandle(), h))
        return false;
}

return true;

}

static bool isEventBlockedByModalComps (MSG& m)
{
if (Component::getNumCurrentlyModalComponents() == 0
|| GetWindowLong (m.hwnd, GWLP_USERDATA) == improbableWindowNumber)
return false;

switch (m.message)
{
    case WM_MOUSEMOVE:
    case WM_NCMOUSEMOVE:
    case 0x020A: /* WM_MOUSEWHEEL */
    case 0x020E: /* WM_MOUSEHWHEEL */
    case WM_KEYUP:
    case WM_SYSKEYUP:
    case WM_CHAR:
    case WM_APPCOMMAND:
    case WM_LBUTTONUP:
    case WM_MBUTTONUP:
    case WM_RBUTTONUP:
    case WM_MOUSEACTIVATE:
    case WM_NCMOUSEHOVER:
    case WM_MOUSEHOVER:
        return isHWNDBlockedByModalComponents (m.hwnd);

    case WM_NCLBUTTONDOWN:
    case WM_NCLBUTTONDBLCLK:
    case WM_NCRBUTTONDOWN:
    case WM_NCRBUTTONDBLCLK:
    case WM_NCMBUTTONDOWN:
    case WM_NCMBUTTONDBLCLK:
    case WM_LBUTTONDOWN:
    case WM_LBUTTONDBLCLK:
    case WM_MBUTTONDOWN:
    case WM_MBUTTONDBLCLK:
    case WM_RBUTTONDOWN:
    case WM_RBUTTONDBLCLK:
    case WM_KEYDOWN:
    case WM_SYSKEYDOWN:
        if (isHWNDBlockedByModalComponents (m.hwnd))
        {
            Component* const modal = Component::getCurrentlyModalComponent (0);
            if (modal != nullptr)
                modal->inputAttemptWhenModal();

            return true;
        }
        break;

    default:
        break;
}

return false;

}
[/code]

?


#3

Now It receives mouse clicks and key presses as long as I don’t touch the scrollbars,
once I try to scroll it behaves again like before, until I presses something not Jucey.


#4

Hmm, no idea about that then! You might want to just not make the window modal… If IE is going to behave strangely in a modal situation, it’d be hard to chase around trying to keep it happy.


#5

OK, I can make it a regular component.

Jules, do you remember the IE tab issue? it will recognize the tab keys only after calling TranslateAccelerator():
http://rawmaterialsoftware.com/viewtopic.php?f=2&t=7101

It’s the only major issue I have with IE.

Thanks