diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp index 94a94ca09..8bfabeec6 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp @@ -88,6 +88,7 @@ enum { RUN_FILE_CHOOSER, CONTEXT_MENU, + CONTEXT_MENU_DISMISSED, LAST_SIGNAL }; @@ -1043,6 +1044,22 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) WEBKIT_TYPE_CONTEXT_MENU, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE, WEBKIT_TYPE_HIT_TEST_RESULT); + + /** + * WebKitWebView::context-menu-dismissed: + * @web_view: the #WebKitWebView on which the signal is emitted + * + * Emitted after #WebKitWebView::context-menu signal, if the context menu is shown, + * to notify that the context menu is dismissed. + */ + signals[CONTEXT_MENU_DISMISSED] = + g_signal_new("context-menu-dismissed", + G_TYPE_FROM_CLASS(webViewClass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(WebKitWebViewClass, context_menu_dismissed), + 0, 0, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static bool updateReplaceContentStatus(WebKitWebView* webView, WebKitLoadEvent loadEvent) @@ -1338,6 +1355,11 @@ static void webkitWebViewCreateAndAppendInputMethodsMenuItem(WebKitWebView* webV webkit_context_menu_insert(contextMenu, menuItem, unicodeMenuItemPosition); } +static void contextMenuDismissed(GtkMenuShell*, WebKitWebView* webView) +{ + g_signal_emit(webView, signals[CONTEXT_MENU_DISMISSED], 0, NULL); +} + void webkitWebViewPopulateContextMenu(WebKitWebView* webView, WKArrayRef wkProposedMenu, WKHitTestResultRef wkHitTestResult) { WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(webView); @@ -1360,6 +1382,8 @@ void webkitWebViewPopulateContextMenu(WebKitWebView* webView, WKArrayRef wkPropo webkitContextMenuPopulate(contextMenu.get(), contextMenuItems); contextMenuProxy->populate(contextMenuItems); + g_signal_connect(contextMenuProxy->gtkMenu(), "deactivate", G_CALLBACK(contextMenuDismissed), webView); + // Clear the menu to make sure it's useless after signal emission. webkit_context_menu_remove_all(contextMenu.get()); } |