After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771802 - User account avatar menu appears in wrong position under Wayland when I use touchscreen
User account avatar menu appears in wrong position under Wayland when I use t...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-09-22 03:26 UTC by Strangiato
Modified: 2017-09-20 03:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bug demonstration (451.38 KB, image/png)
2016-09-22 03:27 UTC, Strangiato
  Details
screenshot (283.04 KB, image/png)
2017-03-21 03:10 UTC, Strangiato
  Details
wayland: Only complain about transient-for if expected (1.21 KB, patch)
2017-03-21 04:02 UTC, Jonas Ådahl
none Details | Review
wayland: Try to guess the grabbed pointer better (3.56 KB, patch)
2017-03-21 04:02 UTC, Jonas Ådahl
none Details | Review

Description Strangiato 2016-09-22 03:26:11 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.
Comment 1 Strangiato 2016-09-22 03:27:29 UTC
Created attachment 336044 [details]
bug demonstration
Comment 2 Jonas Ådahl 2016-09-22 05:04:12 UTC
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.
Comment 3 Strangiato 2017-03-18 21:14:46 UTC
Same thing on 3.24 RC.
Comment 4 Jonas Ådahl 2017-03-21 02:33:22 UTC
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?
Comment 5 Strangiato 2017-03-21 03:09:26 UTC
(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.
Comment 6 Strangiato 2017-03-21 03:10:04 UTC
Created attachment 348369 [details]
screenshot
Comment 7 Jonas Ådahl 2017-03-21 03:41:22 UTC
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.
Comment 8 Jonas Ådahl 2017-03-21 04:02:41 UTC
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
strictly required.
Comment 9 Jonas Ådahl 2017-03-21 04:02:46 UTC
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
pointer master.
Comment 10 Matthias Clasen 2017-03-23 17:11:55 UTC
Carlos, I think this needs your review ?
Comment 11 Strangiato 2017-09-20 03:18:54 UTC
cannot reproduce using Gnome 3.26.