[webkit-reviews] review granted: [Bug 38853] [GTK] Double clicks cause three button press events : [Attachment 56076] Send the proper mouse events during clicking (update)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 1 04:43:31 PDT 2010
Xan Lopez <xan.lopez at gmail.com> has granted Martin Robinson
<mrobinson at webkit.org>'s request for review:
Bug 38853: [GTK] Double clicks cause three button press events
https://bugs.webkit.org/show_bug.cgi?id=38853
Attachment 56076: Send the proper mouse events during clicking (update)
https://bugs.webkit.org/attachment.cgi?id=56076&action=review
------- Additional Comments from Xan Lopez <xan.lopez at gmail.com>
>+ static gint doubleClickDistance = 0;
>+ static gint doubleClickTime = 0;
>+ if (!doubleClickDistance) {
>+ GtkSettings* settings =
gtk_settings_get_for_screen(gdk_drawable_get_screen(widget->window));
>+ g_object_get(settings, "gtk-double-click-distance",
&doubleClickDistance, NULL);
>+ g_object_get(settings, "gtk-double-click-time", &doubleClickTime,
NULL);
>+ }
You should connect to the notify signal in case the values are updated. You can
do this in a follow-up.
>+
>+ PlatformMouseEvent platformEvent(event);
>+
>+ if ((event->type == GDK_2BUTTON_PRESS || event->type ==
GDK_3BUTTON_PRESS)
>+ || ((abs(event->x - previousPoint.x()) < doubleClickDistance)
>+ && (abs(event->y - previousPoint.y()) < doubleClickDistance)
>+ && (event->time - previousTime <
static_cast<guint>(doubleClickTime))
>+ && (event->button == previousButton)))
>+ currentClickCount++;
>+ else
>+ currentClickCount = 1;
We should have a comment explaining why do we have to do the manual check for
increased click count (since GTK+ only checks up to triple click).
LGTM otherwise.
More information about the webkit-reviews
mailing list