diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
commit | 79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch) | |
tree | 0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp | |
parent | 682ab87480e7757346802ce7f54cfdbdfeb2339e (diff) | |
download | qtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz |
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp index a2cc1d97b..b7ffc98b8 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp @@ -46,6 +46,7 @@ #include <WebCore/DataObjectGtk.h> #include <WebCore/DragData.h> #include <WebCore/DragIcon.h> +#include <WebCore/GOwnPtrGtk.h> #include <WebCore/GtkClickCounter.h> #include <WebCore/GtkDragAndDropHelper.h> #include <WebCore/GtkUtilities.h> @@ -94,6 +95,7 @@ struct _WebKitWebViewBasePrivate { #endif GtkWidget* inspectorView; unsigned inspectorViewHeight; + GOwnPtr<GdkEvent> contextMenuEvent; WebContextMenuProxyGtk* activeContextMenuProxy; }; @@ -448,6 +450,10 @@ static gboolean webkitWebViewBaseButtonPressEvent(GtkWidget* widget, GdkEventBut if (!priv->clickCounter.shouldProcessButtonEvent(buttonEvent)) return TRUE; + + // If it's a right click event save it as a possible context menu event. + if (buttonEvent->button == 3) + priv->contextMenuEvent.set(gdk_event_copy(reinterpret_cast<GdkEvent*>(buttonEvent))); priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(reinterpret_cast<GdkEvent*>(buttonEvent), priv->clickCounter.clickCountForGdkButtonEvent(widget, buttonEvent))); return TRUE; @@ -784,3 +790,8 @@ WebContextMenuProxyGtk* webkitWebViewBaseGetActiveContextMenuProxy(WebKitWebView { return webkitWebViewBase->priv->activeContextMenuProxy; } + +GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase* webkitWebViewBase) +{ + return webkitWebViewBase->priv->contextMenuEvent.release(); +} |