[webkit-gtk] The “context-menu” signal question

Carlos Garcia Campos cgarcia at igalia.com
Mon Aug 3 06:02:12 PDT 2015

El lun, 03-08-2015 a las 12:26 +0000, Konovalov, Vadim escribió:
> Hi,
> The manual @ ./webkitgtk-2.8.4/Documentation.webkit2gtk
> -4.0.html.WebKitFrame.html reads:
> gboolean
> user_function (WebKitWebPage          *web_page,
>                WebKitContextMenu      *context_menu,
>                WebKitWebHitTestResult *hit_test_result,
>                gpointer                user_data)
> I can't make this to compile, because - AFAIU this I should compile 
> inside my "extension",  (as long as WebKitWebPage is defined at 
> extension mode)

If you want the context-menu signal of the UI process API, you should
use WebKitWebView::context-menu instead, see


> OTOH WebKitContextMenu and WebKitWebHitTestResult are in WebView mode 
> (as opposed to extension),
> IOW these are defined in opposite H files, which were made impossible 
> to simultaneously "#include" on purpose.
> Obviously I am misreading something simple here.
> The question is simple - what should be #include'd to have this to 
> compile?

It depends, I'm not sure I get what you mean. 

 * If you are building a web extension, you should include
<webkit2/webkit-web-extension.h> only and use WebKitWebPage::context

 * If you are not building a web extension, but a program, you should
include <webkit2/webkit2.h> only and use WebKitWebView::context-menu

The common classes in both APIs are already included in the global

> And please let me sincerely express my gratitude to this excellent 
> piece of software, :)
> TIA,
> Vadim.
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-gtk
Carlos Garcia Campos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20150803/694e7126/attachment.sig>

More information about the webkit-gtk mailing list