Commit 31c1cb0c authored by mrobinson@webkit.org's avatar mrobinson@webkit.org

2010-11-23 Carlos Garcia Campos <cgarcia@igalia.com>

        Reviewed by Martin Robinson.

        focus issue with links that have tooltips
        https://bugs.webkit.org/show_bug.cgi?id=49498

        Set the area of the widget where the tooltip should be shown when
        a new tooltip is set. Since the widget is the same (the view), if
        the tooltip area is not set and a new tooltip is triggered while
        the previous one is still visible, the text of the tooltip is
        updated but its position doesn't change.

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::mouseDidMoveOverElement):
        * webkit/webkitprivate.h:
        * webkit/webkitwebview.cpp:
        (webkit_web_view_query_tooltip):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent be45299e
2010-11-23 Carlos Garcia Campos <cgarcia@igalia.com>
Reviewed by Martin Robinson.
focus issue with links that have tooltips
https://bugs.webkit.org/show_bug.cgi?id=49498
Set the area of the widget where the tooltip should be shown when
a new tooltip is set. Since the widget is the same (the view), if
the tooltip area is not set and a new tooltip is triggered while
the previous one is still visible, the text of the tooltip is
updated but its position doesn't change.
* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::mouseDidMoveOverElement):
* webkit/webkitprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_query_tooltip):
2010-11-21 Mario Sanchez Prada <msanchez@igalia.com>
Reviewed by Chris Fleizach.
......
......@@ -520,6 +520,9 @@ void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned mo
g_signal_emit_by_name(m_webView, "hovering-over-link", 0, 0);
m_hoveredLinkURL = KURL();
}
Node* node = hit.innerNonSharedNode();
m_webView->priv->tooltipArea = node ? node->getRect() : IntRect();
}
void ChromeClient::setToolTip(const String& toolTip, TextDirection)
......
......@@ -55,6 +55,7 @@
#include "HistoryItem.h"
#include "InspectorClientGtk.h"
#include "IntPoint.h"
#include "IntRect.h"
#include "FrameLoaderClient.h"
#include "FullscreenVideoController.h"
#include "Node.h"
......@@ -181,6 +182,7 @@ extern "C" {
CString mainResourceIdentifier;
PlatformRefPtr<GHashTable> subResources;
CString tooltipText;
WebCore::IntRect tooltipArea;
int currentClickCount;
WebCore::IntPoint previousClickPoint;
......
......@@ -1637,6 +1637,13 @@ static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y,
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(widget);
if (priv->tooltipText.length() > 0) {
if (!keyboard_mode) {
if (!priv->tooltipArea.isEmpty()) {
GdkRectangle area = priv->tooltipArea;
gtk_tooltip_set_tip_area(tooltip, &area);
} else
gtk_tooltip_set_tip_area(tooltip, 0);
}
gtk_tooltip_set_text(tooltip, priv->tooltipText.data());
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment