summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit/media_plugin_webkit.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-10-27 17:49:13 -0700
committerMonroe Linden <monroe@lindenlab.com>2009-10-27 17:49:13 -0700
commitc114b6a7d903a62d80f73c321c942ed2bda82d90 (patch)
tree25f7e15c2e9ad24144f38b059fc50e61e6f36748 /indra/media_plugins/webkit/media_plugin_webkit.cpp
parent5274c09b8fd6855bf0e6338c8846d42eb75a9c4a (diff)
Fix for DEV-41544 (focus issues when signing into google docs on MoaP).
Made the webkit plugin code post a tab key event into llqtwebkit on initial focus. This seems to do the right thing in all cases I tested.
Diffstat (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp')
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp11
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")
{