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 792876 - Cannot add bookmark with a touch device
Cannot add bookmark with a touch device
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Bookmarks
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-24 17:20 UTC by Jan-Michael Brummer
Modified: 2018-01-24 20:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow prmary and secondary actions to be opened with touch (1.23 KB, patch)
2018-01-24 18:56 UTC, Jan-Michael Brummer
none Details | Review
Allow prmary and secondary actions to be opened with touch - V2 (2.44 KB, patch)
2018-01-24 20:54 UTC, Jan-Michael Brummer
committed Details | Review

Description Jan-Michael Brummer 2018-01-24 17:20:39 UTC
Using a tablet it is not possible to add a new bookmark. Every press on the star in the location bar does nothing.
Comment 1 Michael Catanzaro 2018-01-24 18:10:51 UTC
In ephy-location-entry.c we register a button press event callback icon_button_press_event_cb, which emits the lock-clicked and bookmark-clicked signals. I guess we need a touch event callback as well.
Comment 2 Jan-Michael Brummer 2018-01-24 18:28:52 UTC
Also (of course) for the primary icon within the entry. Double checked it: occures on wayland and on x.
Comment 3 Jan-Michael Brummer 2018-01-24 18:45:14 UTC
Beside the fact that it is very hard to hit those buttons with a finger i could debug it:

 - It receives a GDK_TOUCH_BEGIN for the finger
 - That's why the check for GDK_BUTTON_PRESS with button == 1 fails

 - Adjusting it to check also for GDK_TOUCH_BEGIN works fine.
 - Not sure if this is the correct solution...
Comment 4 Jan-Michael Brummer 2018-01-24 18:56:47 UTC
Created attachment 367394 [details] [review]
Allow prmary and secondary actions to be opened with touch

Adding the patch.

Regarding my above comment: It is the correct patch as the callback delivers a GdkEvent and the my assumption that it is always a button event is false. Time for a rest :)
Comment 5 Michael Catanzaro 2018-01-24 20:40:00 UTC
Review of attachment 367394 [details] [review]:

Thanks for fixing touch!

I was thinking this was a handler for GtkWidget::button-press-event, and was going to complain that getting a touch event here was crazy. But it's not, it's a handler for GtkEntry::icon-press. That's exceptionally confusing!

So this makes sense. But can you additionally attach another patch to rename icon_button_press_event_cb() to icon_button_icon_press_event_cb(), which should be a somewhat less-confusing name?

::: lib/widgets/ephy-location-entry.c
@@ +731,1 @@
       state == 0 /* left */) {

My remaining reservation is that this state == 0 check doesn't seem to make sense. It seems to be checking for the left mouse button, but that's already ensured above by event->button == 1. (Yay for magic values and no defined constants!) And checking that state == 0 doesn't seem like the right way to check for the left mouse button in the state anyway: the right check should surely be (state & GDK_BUTTON1_MASK). So I think this state == 0 does not make sense for mouse button press either, nor for touch events. I would remove this line as well, and see if anything breaks. ;)
Comment 6 Jan-Michael Brummer 2018-01-24 20:54:25 UTC
Created attachment 367397 [details] [review]
Allow prmary and secondary actions to be opened with touch - V2

As requested renamed function icon_button_press_event_cb() to icon_button_icon_press_event_cb() as it fooled both of us :)

Also removed state check, it has no impact to mouse and touch behaviour.
Comment 7 Michael Catanzaro 2018-01-24 20:57:06 UTC
Looks good, thanks. Will be in 3.26.6.