Bug 212344

Summary: [GTK4] Fix context menu
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, berto, bugs-noreply, ews-watchlist, gustavo
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 210100    
Attachments:
Description Flags
Patch aperez: review+

Description Carlos Garcia Campos 2020-05-25 05:19:19 PDT
It doesn't appear on right click. A warning is shown instead.
Comment 1 Carlos Garcia Campos 2020-05-25 05:24:04 PDT
Created attachment 400196 [details]
Patch
Comment 2 EWS Watchlist 2020-05-25 05:24:45 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Adrian Perez 2020-05-25 06:32:02 PDT
Comment on attachment 400196 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=400196&action=review

> Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:859
> +        gtk_native_check_resize(GTK_NATIVE(priv->activeContextMenuProxy->gtkWidget()));

Cannot we do this inside “WebContextMenuProxyGtk”? We know that the
web view widget is valid when instantiating it, so I would expect that
calling “gtk_native_check_resize()” after setting the web view as parent
widget could work as well 🤔️
Comment 4 Carlos Garcia Campos 2020-05-26 00:47:20 PDT
(In reply to Adrian Perez from comment #3)
> Comment on attachment 400196 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400196&action=review
> 
> > Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:859
> > +        gtk_native_check_resize(GTK_NATIVE(priv->activeContextMenuProxy->gtkWidget()));
> 
> Cannot we do this inside “WebContextMenuProxyGtk”? We know that the
> web view widget is valid when instantiating it, so I would expect that
> calling “gtk_native_check_resize()” after setting the web view as parent
> widget could work as well 🤔️

It needs to be called by the parent in its size_request.
Comment 5 Carlos Garcia Campos 2020-05-26 00:59:37 PDT
Committed r262137: <https://trac.webkit.org/changeset/262137>