Changeset 260252 in webkit


Ignore:
Timestamp:
Apr 17, 2020 8:24:56 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][X11] REGRESSION(r259944): Wrong position of select popup menu in X11
https://bugs.webkit.org/show_bug.cgi?id=210603

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2020-04-17
Reviewed by Michael Catanzaro.

gdk_window_move_to_rect expects the given rectangle in coordinates relative to the top-left corner of the window
that the popup window is transient for. We were using screen coordinates.

  • UIProcess/gtk/WebPopupMenuProxyGtk.cpp:

(WebKit::WebPopupMenuProxyGtk::showPopupMenu): Translate widget coordinates to window coordinates before passing
the rectangle to gdk_window_move_to_rect().

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r260251 r260252  
     12020-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][X11] REGRESSION(r259944): Wrong position of select popup menu in X11
     4        https://bugs.webkit.org/show_bug.cgi?id=210603
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        gdk_window_move_to_rect expects the given rectangle in coordinates relative to the top-left corner of the window
     9        that the popup window is transient for. We were using screen coordinates.
     10
     11        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
     12        (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Translate widget coordinates to window coordinates before passing
     13        the rectangle to gdk_window_move_to_rect().
     14
    1152020-04-17  David Kilzer  <ddkilzer@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp

    r259944 r260252  
    277277    gtk_scrolled_window_set_min_content_height(swindow, itemCount * itemHeight);
    278278
    279     IntPoint menuPosition = convertWidgetPointToScreenPoint(m_webView, rect.location());
    280279#if GTK_CHECK_VERSION(3, 24, 0)
    281     GdkRectangle windowRect = { menuPosition.x(), menuPosition.y(), rect.width(), rect.height() };
     280    GdkRectangle windowRect = { rect.x(), rect.y(), rect.width(), rect.height() };
     281    gtk_widget_translate_coordinates(m_webView, toplevel, windowRect.x, windowRect.y, &windowRect.x, &windowRect.y);
    282282    gdk_window_move_to_rect(gtk_widget_get_window(m_popup), &windowRect, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST,
    283283        static_cast<GdkAnchorHints>(GDK_ANCHOR_FLIP | GDK_ANCHOR_SLIDE | GDK_ANCHOR_RESIZE), 0, 0);
     
    286286    gtk_widget_get_preferred_size(m_popup, &menuRequisition, nullptr);
    287287
     288    IntPoint menuPosition = convertWidgetPointToScreenPoint(m_webView, rect.location());
    288289    if (menuPosition.x() + menuRequisition.width > area.x + area.width)
    289290        menuPosition.setX(area.x + area.width - menuRequisition.width);
Note: See TracChangeset for help on using the changeset viewer.