diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tab-body.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/tab-body.c b/src/tab-body.c index 1407b01..8f12108 100644 --- a/src/tab-body.c +++ b/src/tab-body.c @@ -27,6 +27,32 @@ #include "tab-body.h" #include "tab.h" +static gboolean +context_menu_cb(WebKitWebView *web_view, WebKitContextMenu *context_menu, + GdkEvent *event, WebKitHitTestResult *hit_test_result, MqTabBody *body) +{ + WebKitHitTestResultContext context; + + context = webkit_hit_test_result_get_context(hit_test_result); + + g_print("Context menu, hit test:"); + if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT) + g_print(" document"); + if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK) + g_print(" link"); + if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE) + g_print(" image"); + if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA) + g_print(" media"); + if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE) + g_print(" editable"); + if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR) + g_print(" scrollbar"); + g_print("\n"); + + return FALSE; +} + MqTabBody * mq_tab_body_new(MqTab *tab, gchar *uri) { @@ -45,6 +71,9 @@ mq_tab_body_new(MqTab *tab, gchar *uri) /* FIXME: This doesn't seem to be working. */ gtk_widget_grab_focus(body->container); + g_signal_connect(body->web_view, "context-menu", + G_CALLBACK(context_menu_cb), body); + return body; } |