WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
145866
[GTK] Attach popup menu to web view widget
https://bugs.webkit.org/show_bug.cgi?id=145866
Summary
[GTK] Attach popup menu to web view widget
Jonas Ådahl
Reported
2015-06-10 19:47:23 PDT
In order to avoid having the GDK backend guess what the parent widget of the popup is, set it explicitly. This makes popup menus work more reliably under Wayland, as a popup menu is always required to be attached to a parent window.
Attachments
Patch
(1.74 KB, patch)
2015-06-10 20:18 PDT
,
Jonas Ådahl
no flags
Details
Formatted Diff
Diff
Patch
(1.85 KB, patch)
2017-04-11 03:32 PDT
,
Adrian Perez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jonas Ådahl
Comment 1
2015-06-10 20:18:52 PDT
Created
attachment 254704
[details]
Patch
Michael Catanzaro
Comment 2
2015-07-07 10:03:04 PDT
Zan, can you review this please? It's a one-liner. I will just say that the patch should use nullptr instead of 0.
Zan Dobersek
Comment 3
2015-07-08 23:02:26 PDT
Comment on
attachment 254704
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=254704&action=review
> Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp:133 > + gtk_menu_attach_to_widget(GTK_MENU(m_popup), GTK_WIDGET(m_webView), 0);
Right, nullptr is preferred.
Adrian Perez
Comment 4
2017-04-10 09:36:16 PDT
This is related to
bug #170553
, which is to move to non-deprecated functions which handle positioning of popups more reliably. I think it is still desirable to attach the popup to the web view because even when we will be using gtk_menu_popup_at_{rect,widget,pointer} those functions do not attach the menu to the widget (at least that's my understanding from reading the GTK+ documentation). Jonas, will you be updating this patch, or do you want me to update it and land it for you?
Jonas Ådahl
Comment 5
2017-04-10 17:19:07 PDT
(In reply to Adrian Perez from
comment #4
)
> This is related to
bug #170553
, which is to move to non-deprecated > functions which handle positioning of popups more reliably. I think > it is still desirable to attach the popup to the web view because > even when we will be using gtk_menu_popup_at_{rect,widget,pointer} > those functions do not attach the menu to the widget (at least that's > my understanding from reading the GTK+ documentation). > > Jonas, will you be updating this patch, or do you want me to update > it and land it for you?
Seems I had forgotten about this. If you could rebase and land, that would be great, as I don't have a recent tree checked out nor built. If your time is limited, I'll try to get it done in the coming days.
Adrian Perez
Comment 6
2017-04-11 00:48:34 PDT
(In reply to Jonas Ådahl from
comment #5
)
> (In reply to Adrian Perez from
comment #4
) > > This is related to
bug #170553
, which is to move to non-deprecated > > functions which handle positioning of popups more reliably. I think > > it is still desirable to attach the popup to the web view because > > even when we will be using gtk_menu_popup_at_{rect,widget,pointer} > > those functions do not attach the menu to the widget (at least that's > > my understanding from reading the GTK+ documentation). > > > > Jonas, will you be updating this patch, or do you want me to update > > it and land it for you? > > Seems I had forgotten about this. If you could rebase and land, that would > be great, as I don't have a recent tree checked out nor built. If your time > is limited, I'll try to get it done in the coming days.
I have been hunting popup menu bugs the last days, so I'll just go ahead and get this landed — I'll credit you in the log. Thanks for the patch and for stopping by for commenting :-)
Adrian Perez
Comment 7
2017-04-11 00:50:52 PDT
FWIW, this does not apply cleanly after the patch for
bug #170553
has landed and needed a rebase. I am now waiting for a build that I can smoketest before posting an updated version.
Adrian Perez
Comment 8
2017-04-11 03:29:09 PDT
This seems to fix the remaining issue that we had with popup menus in Wayland: after applying this on current “master”, menus with a lot of elements are correctly resized and repositioned to fit in the current screen when running *under Mutter* (and hence GNOME Shell). Under Weston, long menus still bleed outside of the screen. Most likely my Weston is too old for the version of the “xdg_popup” interface (part of “xdg_shell”) that GTK+ is using. Probably this could happen with other Wayland compositors as well. I think this is fine: we do all that is possible from our part with what GTK+ provides, and IMHO the ball would be now in the court of the compositors that don't implement the “xdg_popup” interface. I'll upload the patch in a moment.
Adrian Perez
Comment 9
2017-04-11 03:32:45 PDT
Created
attachment 306793
[details]
Patch
WebKit Commit Bot
Comment 10
2017-04-11 04:19:57 PDT
Comment on
attachment 306793
[details]
Patch Clearing flags on attachment: 306793 Committed
r215225
: <
http://trac.webkit.org/changeset/215225
>
WebKit Commit Bot
Comment 11
2017-04-11 04:19:58 PDT
All reviewed patches have been landed. Closing bug.
Jonas Ådahl
Comment 12
2017-04-11 04:24:01 PDT
(In reply to Adrian Perez from
comment #8
)
> This seems to fix the remaining issue that we had with popup menus > in Wayland: after applying this on current “master”, menus with a > lot of elements are correctly resized and repositioned to fit in the > current screen when running *under Mutter* (and hence GNOME Shell). > > Under Weston, long menus still bleed outside of the screen. Most likely > my Weston is too old for the version of the “xdg_popup” interface (part > of “xdg_shell”) that GTK+ is using. Probably this could happen with > other Wayland compositors as well. I think this is fine: we do all > that is possible from our part with what GTK+ provides, and IMHO the > ball would be now in the court of the compositors that don't implement > the “xdg_popup” interface.
This is only because libweston-desktop (used by "weston") only having partially implemented xdg-shell (last time I checked this was the case). It implements the positioning, but not the constraining, which is fine according to spec, but less good from a UX point of view. There is nothing WebKit or GTK+ should do about anything about however.
> > I'll upload the patch in a moment.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug