Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4128 closed defect (fixed)

Journal entry activity icon: implement long-press behavior

Reported by: erikos Owned by: erikos
Priority: Urgent Milestone:
Component: Sugar Version: 0.97.x
Severity: Critical Keywords: olpc-test-passed
Cc: Distribution/OS: OLPC
Bug Status: Assigned

Description

see #3992

Attachments (3)

0001-CellRendererInvoker-add-support-for-long-press-event.patch (5.7 KB) - added by erikos 8 years ago.
CellRendererInvoker: add support for long-press events
0001-palettewindow-Don-t-recompute-visibility-on-touchscr.patch (2.1 KB) - added by garnacho 8 years ago.
patch to ignore motion/crossing events on touchscreen devices
motion.py (888 bytes) - added by erikos 8 years ago.
Test app that prints motion events, touch events and button-release events

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by erikos

CellRendererInvoker: add support for long-press events

comment:1 Changed 8 years ago by erikos

Attached is a first patch. There are some edge cases I am not sure about yet. Here is my current analysis:

This one is tricky because where the CellRendererInvoker is
used (Home View activity list and Journal list view) we do
use Palettes based on a GtkMenu. In the Journal list view
this Palette has submenus so it can not be easily replaced
with our custom Palette. That is why I am trying to make this
case work with a GtkMenu.


When the Palette does pop up it grabs the focus. This means that
the invoker does not see a TOUCH_END event. Same is the longpress
controller that is why we have to reset the controller when
the long-press is detected, otherwise it is not usable a second
time.


The default behavior of a GtkMenu is that it does pop down
on a long press/release event. So when doing a long press
on the icon the Palette was popping down directly. We can
stop this by listening on the button-release event in the
Menu and return True when the event happens in the invoker
coordinates.


Finally there are several issues with motion events: in the
invoker we listen to motion events on the treeview in order to
be able to popup/popdown the Palette on hovering over the
icon. This event is triggered as well when the icon is
tapped. I am not sure this is expected behavior and if it is
correct by design how to prevent it.


The second case where the motion events are triggered is
when you tap somewhere in the Palette when it is up. For
example you want to get to one of the submenues. Since the
Palette tracks motion events to work for the hover case [2]
we do get a leave event when the Palette is tapped and the
Palette does pop down. Same here, do we know when the motion
event is coming from a mouse or not? How could this be
prevented? Should I track if a Palette is raised by a mouse
click or a touch event and only do the motion tracking when
the mouse is in use?


[1] http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/blobs/master
[2] http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/blobs/master

Changed 8 years ago by garnacho

patch to ignore motion/crossing events on touchscreen devices

Changed 8 years ago by erikos

Test app that prints motion events, touch events and button-release events

comment:3 Changed 8 years ago by erikos

  • Keywords olpc-test-pending added
  • Resolution set to fixed
  • Status changed from new to closed

In 0.97.9 we landed the above patch with the code to check if the event originated from a touchscreen and do discard it in that case. http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/commit/ad9b0e98668954022a98cb5fdc63196d947c1b38

Carlos fixed the controller, so we do not have to reset it manually anymore: http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/commit/b2df1358447c39e3a4720af2286846d516ea3b02

Removed workaround: http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/commit/c64d5590b0798c54bb864af14c05edc2cccd6f89

The big part of this feature has landed, there is an issue with performance in the listviews, the longpress event is longer than in the other cases (e.g. Home View) filed in #4166

comment:4 Changed 8 years ago by greenfeld

  • Keywords olpc-test-passed added; olpc-test-pending removed

Journal entry icons show their secondary menu(s) given a long touch press in Sugar 0.98.2/OLPC 13.1.0 os20.

comment:5 Changed 8 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.