GNOME Bugzilla – Bug 771802
User account avatar menu appears in wrong position under Wayland when I use touchscreen
Last modified: 2017-09-20 03:18:54 UTC
steps to reproduce
open settings center, open "users"
"click" on user account avatar using your touchscreen
menu appears in wrong position on screen. See the screenshot please.
Created attachment 336044 [details]
Seems to be GDK can't guess the transient-for correctly because gnome-control-center doesn't set a transient-for. Thus, moving to GTK+. With that said, gnome-control-center shouldn't let GDK guess so much.
Same thing on 3.24 RC.
Can't reproduce this on on 3.24. GTK+ complains about a noughty gnome-contror-center popup, but it maps correctly here. Is this still about clicking the avatar in gnome-control-center?
(In reply to Jonas Ådahl from comment #4)
> Is this still about
> clicking the avatar in gnome-control-center?
Yes. Using touchscreen.
Here is a screenshot.
Created attachment 348369 [details]
Ugh, right, this is about touch. What seems to be biting us is that touch is emulated as pointer clicks in gtk+, so the popup code assumes that it can pass around a pointer thinking it makes sense. Then, when that pointer eventually is used to figure out the window under it, if the *real* pointer might very well be somewhere completely else than the touch-down.
You can for example "work around" the issue by moving the pointer to be above the gnome-control-center window, then touch the avatar. When gdk eventually uses the pointer to guess the parent, it finds the correct one by accident.
For GTK4, I'd say we should get rid of any touch-emulated-as-mouse code, but for GTK3, I wonder how much better we can do. Maybe we can change the guessing code to check the latest implicit grab on the seat and check if it was an emulated pointer click or something.
Created attachment 348371 [details] [review]
wayland: Only complain about transient-for if expected
Only complain about the missing transient-for in the xdg_popup
configure handler if the popup was mapped using the move_to_rect
mechanism, as that is the only mechanism where a transient-for is
Created attachment 348372 [details] [review]
wayland: Try to guess the grabbed pointer better
When a popup is mapped as a result of a "click" on the emulated touch
pointer, we should not use the actual pointer to get any coordinates
when guessing the transient-for of popup when mapping.
Instead, let the seat guess what pointer was grabbed, and use that to
get the coordinate for transient-for guessing. The guessing is done by
checking if the touch master has an emulated touch point (i.e. if there
is any active touch point) and if so guessing that the touch master
'pointer' was the one grabbed; otherwise fall back to the actual
Carlos, I think this needs your review ?
cannot reproduce using Gnome 3.26.