[Webkit-unassigned] [Bug 32819] [GTK] Change the tooltip implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 11 04:38:45 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=32819





--- Comment #6 from Alejandro G. Castro <alex at igalia.com>  2010-01-11 04:38:42 PST ---
(In reply to comment #5)
> (From update of attachment 45378 [details])
> > +#if GTK_CHECK_VERSION(2, 12, 0)
> > +    priv->tooltipText = 0;
> > +    gtk_widget_set_has_tooltip(GTK_WIDGET(webView), TRUE);
> > +    g_signal_connect(webView, "query-tooltip", G_CALLBACK(webkit_web_view_query_tooltip), 0);
> > +#endif
> 
> You should override the GtkWidget class method instead of connecting to the
> signal.
> 

Yep, I'll do it.

> > +void webkit_web_view_set_tooltip_text(WebKitWebView* webView, const char* tooltip)
> > +{
> > +    WebKitWebViewPrivate* priv = webView->priv;
> > +    g_free(priv->tooltipText);
> > +    if (tooltip && *tooltip != '\0')
> > +        priv->tooltipText = g_strdup(tooltip);
> > +    else
> > +        priv->tooltipText = 0;
> > +}
> 
> What about the 'has-tooltip' property? You should probably set it to
> TRUE/FALSE, as appropriate, here. Otherwise the tooltips will only be displayed
> when the webview has keyboard focus, as I understand it. The patch looks
> awesome otherwise, nice work!

AFAIK the property is a widget property and you just have to set it to TRUE
once in order to receive the tooltip events. But now that you point out this,
one interesting thing would be to avoid the gtkwidget check and use just the
webkit one, i.e. set query-tooltip always to FALSE and use
gtk_tooltip_trigger_tooltip_query. I'll try to do this.

Thanks for the comments :).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list