RESOLVED FIXED 59715
[GTK] Click counting logic should be shared between WebKit1 and WebKit2
https://bugs.webkit.org/show_bug.cgi?id=59715
Summary [GTK] Click counting logic should be shared between WebKit1 and WebKit2
Martin Robinson
Reported Thursday, April 28, 2011 6:57:24 PM UTC
The click counting logic is currently duplicated for both ports. We should push this down into WebCore as a utility class. This has the added benefit of helping put WebKitWebView on a diet.
Attachments
Patch (21.77 KB, patch)
2011-04-28 11:10 PDT, Martin Robinson
no flags
Martin Robinson
Comment 1 Thursday, April 28, 2011 7:10:07 PM UTC
WebKit Review Bot
Comment 2 Thursday, April 28, 2011 7:13:22 PM UTC
Attachment 91519 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/platform/gtk/GtkClickCounter.cpp:80: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Xan Lopez
Comment 3 Thursday, April 28, 2011 7:28:16 PM UTC
Comment on attachment 91519 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=91519&action=review Great stuff! > Source/WebCore/platform/gtk/GtkClickCounter.cpp:23 > +#include <gdk/gdk.h> I suppose this comes for free from gtk.h > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-339 > - I actually object to this line being removed! Buurn.
Martin Robinson
Comment 4 Thursday, April 28, 2011 7:38:16 PM UTC
WebKit Review Bot
Comment 5 Thursday, April 28, 2011 8:45:17 PM UTC
http://trac.webkit.org/changeset/85214 might have broken GTK Linux 64-bit Debug
Martin Robinson
Comment 6 Thursday, April 28, 2011 11:33:00 PM UTC
Comment on attachment 91519 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=91519&action=review > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:274 > WebKitWebViewBasePrivate* priv = webViewBase->priv; > - > priv->page->handleMouseEvent(NativeWebMouseEvent(reinterpret_cast<GdkEvent*>(event), 0 /* currentClickCount */)); This was extra and I can omit it from the patch.
Carlos Garcia Campos
Comment 7 Friday, April 29, 2011 7:46:29 AM UTC
Comment on attachment 91519 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=91519&action=review > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-151 > - priv->pageClient = PageClientImpl::create(GTK_WIDGET(webkitWebViewBase)); This line should not be removed. > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-268 > - if (buttonEvent->button == 3) { > - // FIXME: [GTK] Add context menu support for Webkit2. > - // https://bugs.webkit.org/show_bug.cgi?id=54827 > - notImplemented(); > - return FALSE; > - } > - Why did you remove these lines? we haven't added support for context menus yet.
Martin Robinson
Comment 8 Friday, April 29, 2011 1:25:35 PM UTC
Comment on attachment 91519 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=91519&action=review >> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-151 >> - priv->pageClient = PageClientImpl::create(GTK_WIDGET(webkitWebViewBase)); > > This line should not be removed. Indeed. That was a mistake. >> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-268 >> - > > Why did you remove these lines? we haven't added support for context menus yet. That's correct, but I believe that an early return here prevents detecting double, triple, quadruple, etc third button clicks. If we need to generate context menu events, it should happen later in this method.
Carlos Garcia Campos
Comment 9 Friday, April 29, 2011 1:33:57 PM UTC
(In reply to comment #8) > (From update of attachment 91519 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=91519&action=review > > >> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-151 > >> - priv->pageClient = PageClientImpl::create(GTK_WIDGET(webkitWebViewBase)); > > > > This line should not be removed. > > Indeed. That was a mistake. No problem, I already fixed it. > >> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:-268 > >> - > > > > Why did you remove these lines? we haven't added support for context menus yet. > > That's correct, but I believe that an early return here prevents detecting double, triple, quadruple, etc third button clicks. If we need to generate context menu events, it should happen later in this method. Patch for bug #54827 would remove those lines anyway.
Note You need to log in before you can comment on or make changes to this bug.