Bug 210069 - [GTK] Use gdk_window_move_to_rect() to position popup menus
Summary: [GTK] Use gdk_window_move_to_rect() to position popup menus
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-06 13:26 PDT by Michael Catanzaro
Modified: 2020-04-16 06:28 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.77 KB, patch)
2020-04-11 05:58 PDT, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff
Regression: dropdown select menus mispositioned (128.00 KB, image/png)
2020-04-16 04:17 PDT, Jim Mason
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2020-04-06 13:26:34 PDT
Bug title: [GTK] Use gdk_window_move_to_rect() to position popup menus

WebPopupMenuProxyGtk::showPopupMenu currently uses gtk_window_move() to position the popup menu. Jonas doesn't like this; he says it can cause the menu to be positioned offscreen. Indeed, we have a longstanding bug where context menus near the bottom of the window will exceed the length of the screen. Jonas says Firefox doesn't have this problem, and that the fix would be to use gdk_window_move_to_rect() instead. Our code already has a FIXME to do this, with a pointer to a bug report asking for that API (which was private at the time) to be exported:

// FIXME: We can't ensure the menu will be on screen in Wayland.
// https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/
// https://gitlab.gnome.org/GNOME/gtk/issues/997

I looked into trying this, but it didn't look simple.
Comment 1 Carlos Garcia Campos 2020-04-11 05:58:00 PDT
Created attachment 396162 [details]
Patch
Comment 2 Carlos Garcia Campos 2020-04-12 02:28:52 PDT
Committed r259944: <https://trac.webkit.org/changeset/259944>
Comment 3 Jim Mason 2020-04-16 04:17:07 PDT
Created attachment 396632 [details]
Regression: dropdown select menus mispositioned

With this patch, I am finding that dropdown SELECT menus are mispositioned.  See attachment.

GTK 3.24.11 / X11

(If I should be opening new slips for regressions, please let me know.)