summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-25 22:34:26 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-26 03:33:54 (EDT)
commitf6ee760192e6c208a00b1e7ad252e8abf4e34a62 (patch)
tree04a9f5f918102fc8c49777a97715912749bb2671
parent92fe4ae2f819abb70a0ea9405347e169deea8eac (diff)
downloadmarquee-f6ee760192e6c208a00b1e7ad252e8abf4e34a62.zip
marquee-f6ee760192e6c208a00b1e7ad252e8abf4e34a62.tar.gz
marquee-f6ee760192e6c208a00b1e7ad252e8abf4e34a62.tar.bz2
MqTabBody: Add stub context menu handler
-rw-r--r--src/tab-body.c29
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;
}