GNOME Bugzilla – Bug 776903
Label with hyperlinks cannot be opened with touch on wayland
Last modified: 2017-07-26 14:20:04 UTC
Labels with hyperlinks attached (e.g. about dialog url/emails) cannot be visited using touch input under wayland (X works fine). Reproduce: gtk3-demo -> Links, or about dialog in every GNOME application.
Issue is caused by missing GDK_MOTION_NOTIFY under wayland for the tablet input. This leads to an empty active_link in GtkLabel as gtk_label_motion() is never called. One fix (that works) is calling gtk_label_motion() in gtk_label_multipress_gesture_pressed() before checking active_link.
Created attachment 348745 [details] [review] Patch fixing link handling with a tablet under wayland
Anybody ready for a review?
Comment on attachment 348745 [details] [review] Patch fixing link handling with a tablet under wayland Thanks for the patch. The analysis is right, I however don't think it is correct to call the label motion handler manually. Most importantly it's wrong to chain up on the motion-notify vmethod here as it would be the case, it's also wrong to pass other event than GDK_MOTION_NOTIFY to such vmethod (you'll receive GDK_BUTTON_PRESS or GDK_TOUCH_BEGIN here, depending on the widget event mask). It happens to work by coincidence because the event structs are binary compatible for the fields that are looked up. But the fix is not totally off, we just need refactoring the "update active link" bits into a separate event-agnostic function and call it from both the widget motion and the gesture press handlers. I'm attaching here a new patch doing that.
Created attachment 356366 [details] [review] gtklabel: Fix touch link handling under wayland Refactor the code updating the active link under the current coordinates into a separate function, and call it on GtkGestureMultiPress::pressed so the link is updated on GDK_TOUCH_BEGIN. Based on a patch by Jan-Michael Brummer <jan.brummer@tabos.org>.
Thank you very much for the review. Your patch looks much better and it works well on my tablet.
Carlos, does your patch needs another reviewer or can it be applied to git?
Thanks, it's gotten enough testing :). Pushed to git. Attachment 356366 [details] pushed as d6d4217 - gtklabel: Fix touch link handling under wayland
*** Bug 785339 has been marked as a duplicate of this bug. ***