diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-10-28 09:32:48 -0700 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-10-28 09:32:48 -0700 |
commit | c4992e30654775c54e3dc4fb583375ec079b23a4 (patch) | |
tree | 31af4a671d5f0b238ffe99a141967bfc977cd69b /indra/media_plugins/webkit/media_plugin_webkit.cpp | |
parent | 88166e7d222bf18fc0324714dc44efef161bc409 (diff) | |
parent | ea5a60c80f0243a7e5a6a7fd8357e7c3cd6b5d4d (diff) |
Merge from remote repo
Diffstat (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp')
-rw-r--r-- | indra/media_plugins/webkit/media_plugin_webkit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index e42f9739f4..7c9e27a760 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -83,6 +83,7 @@ private: bool mCanPaste; int mLastMouseX; int mLastMouseY; + bool mFirstFocus; //////////////////////////////////////////////////////////////////////////////// // @@ -495,6 +496,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ mCanPaste = false; mLastMouseX = 0; mLastMouseY = 0; + mFirstFocus = true; } MediaPluginWebKit::~MediaPluginWebKit() @@ -769,6 +771,15 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) { bool val = message_in.getValueBoolean("focused"); LLQtWebKit::getInstance()->focusBrowser( mBrowserWindowId, val ); + + if(mFirstFocus && val) + { + // On the first focus, post a tab key event. This fixes a problem with initial focus. + std::string empty; + keyEvent(LLQtWebKit::KE_KEY_DOWN, KEY_TAB, decodeModifiers(empty)); + keyEvent(LLQtWebKit::KE_KEY_UP, KEY_TAB, decodeModifiers(empty)); + mFirstFocus = false; + } } else if(message_name == "clear_cache") { |