[Wayland-bugs] [Bug 774148] Gtk.Popover misplacement in Wayland

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Wed Feb 1 14:22:42 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=774148

--- Comment #4 from Olivier Fourdan <ofourdan at redhat.com> ---
Created attachment 344713
  --> https://bugzilla.gnome.org/attachment.cgi?id=344713&action=edit
[PATCH] gtkwidget: return translated coords

hen the GtkWidget hierarchy does not match the GdkWindow hierarchy, the
GtkWidget code may find a common ancestor that cannot be found while
traversing the GdkWindow tree.

This happens with for example on Wayland, a GtkPopover has another
GtkPopover as parent, in this case, the GdkWindow parent is the root
window, whereas the GtkWidget parent is the other GtkPopover.

That confuses the gtk_widget_translate_coordinates() logic which will
bail out in this case and won't return the translated coordinates.

For this particular corner case, translate the coordinates but still
return FALSE.

The existing GTK+ API for gtk_widget_translate_coordinates() states that
it would return FALSE if either widget was not realized, or there was no
common ancestor, in which case nothing is stored in the return
variables, so this particular corner case should not affect the
documented behavior.

--
/!\ This is a corner case, some sort of a grey area in the documented behavior,
I am not sure about the possible side-effects of this patch - But it seems to
fix this particular issue with popover on Wayland...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20170201/938562e7/attachment.html>


More information about the wayland-bugs mailing list