Comment 458 for bug 263435

Revision history for this message
In , Ws-bugzilla (ws-bugzilla) wrote :

The patch doesn't work for me on Windows. PluginWndProc does not receive any events when the plugin is focused and keys are pressed. Additionally, PostMessage WM_KILLFOCUS doesn't have any effect even when it does get executed. I believe the former issue has been hinted at in the early comments on this bug.

My own kludge sets a timer and uses GetKeyState to observe keys being pressed, but being thorougly unfamiliar with the codebase I could not find the right widget to focus.

To summarize:

    ::PostMessage(hWnd, WM_KILLFOCUS, NULL, NULL);

doesn't unfocus the plugin at all for me; it still shows the yellow focus rectangles and TAB tabs through the plugin's controls.

          nsCOMPtr<nsIWidget> widget;
          win->GetPluginWidget(getter_AddRefs(widget));
          while (widget != NULL)
          {
            widget->SetFocus(false);
            widget = widget->GetParent();
          }

This unfocuses the plugin (TAB no longer tabs through plugin's controls), but whatever this does focus is not what we want; all keys are still swallowed. Moreover, Alt+Tab and back re-focuses the plugin. So my snippet is pretty wrong too.

Would it make more sense to discuss the specifics of the workaround patch in bug 625809?