RESOLVED FIXED 210603
[GTK][X11] REGRESSION(r259944): Wrong position of select popup menu in X11
https://bugs.webkit.org/show_bug.cgi?id=210603
Summary [GTK][X11] REGRESSION(r259944): Wrong position of select popup menu in X11
Carlos Garcia Campos
Reported 2020-04-16 06:28:41 PDT
It works in Wayland, but fails in X11.
Attachments
Patch (2.47 KB, patch)
2020-04-17 06:18 PDT, Carlos Garcia Campos
no flags
Carlos Garcia Campos
Comment 1 2020-04-16 07:30:40 PDT
Does anybody know how to make gdk_window_move_to_rect() work in X11? It seems we need to convert the coordinates somehow, but I don't know exactly how. gtk_window_move() works fine in X11, so if I can't make gdk_window_move_to_rect() work for both I'll use it only under wayland.
Michael Catanzaro
Comment 2 2020-04-16 08:27:11 PDT
Jonas says: "i don't understand the question. that API is used internally in gtk by both wayland and x11" (In reply to Carlos Garcia Campos from comment #1) > gtk_window_move() works fine in X11, so if I can't make > gdk_window_move_to_rect() work for both I'll use it only under wayland. I learned a Finnish proverb from Adrian: "the reindeer will go where the fence is the lowest." The reindeer are wise....
Adrian Perez
Comment 3 2020-04-16 16:18:44 PDT
Maybe the long-term solution for this is using GtkPopover[Menu], like I just did for bug #170553 — then we can let GTK do the positioning work using gtk_popover_set_pointing_to(widget, rect) and gtk_popover_set_position(widget, GTK_POS_BOTTOM) to make the popover appear below the button. If we want to remove the arrow that would point to the button or change the appearance I *think* there are some CSS classes we can set. As for making the popover width at least as long as the button, I think *maybe* we could use a GtkSizeGroup, but maybe if we end up using a popover there is not much point in doing that 🤔️
Carlos Garcia Campos
Comment 4 2020-04-17 06:18:18 PDT
Created attachment 396761 [details] Patch Managed to make it work in the end.
Michael Catanzaro
Comment 5 2020-04-17 08:09:38 PDT
Comment on attachment 396761 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396761&action=review > Source/WebKit/ChangeLog:9 > + 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. Yup.
EWS
Comment 6 2020-04-17 08:25:00 PDT
Committed r260252: <https://trac.webkit.org/changeset/260252> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396761 [details].
Note You need to log in before you can comment on or make changes to this bug.