GEIS returns invalid arguments

Bug #986886 reported by José Expósito
184
This bug affects 41 people
Affects Status Importance Assigned to Milestone
Geis
Confirmed
Medium
Unassigned
Touchegg
Unknown
Unknown

Bug Description

As you can see in the snipped attached by Jussi:
https://bugs.launchpad.net/utouch-geis/+bug/853958/comments/14

The gesture type is "n/a", the number of fingers is incorrect, etc
Tested in Precise with KDE

Tags: multitouch
affects: utouch-geis → touchegg
affects: touchegg → utouch-geis
Revision history for this message
Bradley Jones (bradjones) wrote :

Status changed to confirmed because it affects multiple people

Changed in utouch-geis:
status: New → Confirmed
tags: added: multitouch
Revision history for this message
Stephen M. Webb (bregma) wrote :

In GEISv2, the "gesture name" does not make any sense, since a gesture frame may be classified in one or more ways. If you wish to see if a gesture frame belongs to a specific class, you need to use the geis_frame_is_class() call.

The documentation regarding GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME reads as follows.

  This attribute is filled only when using GEIS v1 API (the simplified
   interface). On GEIS v2 this attribute has been replaced by the concept of
   gesture classes. Use geis_frame_is_class() instead.

Regarding the number of touches and the et cetera (which is what, exactly?), could you please use the evemu-record tool from the utouch-evemu-tools package to capture the gesture performed on your input device that is causing the problem, and also use the evemu-describe tool from the same package to capture a device description of your device. Please attach both the description file and the recording file to this bug.

Changed in utouch-geis:
status: Confirmed → Incomplete
Revision history for this message
cros13 (cros13) wrote :

I'm afflicted by this bug as well.

I could not get any output from evemu-record for the correct device for some reason.

I'm attaching some output from utouch-frame-test-x11 with a sample gesture.
Also attaching output from touchegg for the same gesture.

Revision history for this message
cros13 (cros13) wrote :

forgot the touchegg output

Revision history for this message
Alexander Rau (alexander-rau86) wrote :

same problem with gnome-shell 3.4 on Ubuntu 12.04 64 bit

Revision history for this message
José Expósito (jose-exposito89) wrote :

Looks like the API is not retrocompatible. I can say that in the previous uTouch version (Oneiric) "gesture name" contains a valid value, but now with this code:

QHash<QString, QVariant> GestureCollector::getGestureAttrs(GeisEvent event)
{
    QHash<QString, QVariant> ret;

    GeisAttr attr = geis_event_attr_by_name(event,
            GEIS_EVENT_ATTRIBUTE_GROUPSET);
    GeisGroupSet groupset = (GeisGroupSet)geis_attr_value_to_pointer(attr);

    for (GeisSize i = 0; i < geis_groupset_group_count(groupset); ++i) {
        GeisSize j;
        GeisGroup group = geis_groupset_group(groupset, i);

        for (j = 0; j < geis_group_frame_count(group); ++j) {
            GeisSize k;
            GeisFrame frame = geis_group_frame(group, j);
            GeisSize attr_count = geis_frame_attr_count(frame);

            for (k = 0; k < attr_count; ++k) {
                GeisAttr gestureAttr = geis_frame_attr(frame, k);
                QString attrName = geis_attr_name(gestureAttr);
                QVariant value;

                switch (geis_attr_type(gestureAttr)) {
                case GEIS_ATTR_TYPE_BOOLEAN:
                    value = geis_attr_value_to_boolean(gestureAttr);
                    break;
                case GEIS_ATTR_TYPE_FLOAT:
                    value = geis_attr_value_to_float(gestureAttr);
                    break;
                case GEIS_ATTR_TYPE_INTEGER:
                    value = geis_attr_value_to_integer(gestureAttr);
                    break;
                case GEIS_ATTR_TYPE_STRING:
                    value = geis_attr_value_to_string(gestureAttr);
                    break;
                default:
                    break;
                }

                qDebug() << attrName << value;

                if (!value.isNull()) {
                    ret.insert(attrName, value);
                }
            }
        }
    }

    return ret;
}

I get this output: (for a three touches tap)

"timestamp" QVariant(int, 608258)
"device id" QVariant(int, 20240)
"root window id" QVariant(int, 172)
"event window id" QVariant(int, 172)
"child window id" QVariant(int, 172)
"touches" QVariant(int, 3)
"focus x" QVariant(float, 471)
"focus y" QVariant(float, 563)
"boundingbox x1" QVariant(float, -2279)
"boundingbox y1" QVariant(float, 2018)
"boundingbox x2" QVariant(float, 1429)
"boundingbox y2" QVariant(float, 4332)
"gesture name" QVariant(QString, "n/a")

In addition looks like the "* window id" is always the root window. How to fix this two errors?

Revision history for this message
Leandro Facchinetti (leafac) wrote :

I'm also affected by this bug.
I'm trying to use http://code.google.com/p/touchegg in Ubuntu 12.04 and due to this issue, it doesn't work.

Revision history for this message
damodamo (damocles-476977) wrote :

Same problem here using touchegg on Kubuntu 12.04.

Revision history for this message
Stephen M. Webb (bregma) wrote :

The documented API for determining how to classify a gesture in GEIS is geis_frame_is_class() (see http://developer.ubuntu.com/api/ubuntu-12.04/cplusplus/utouch-geis/group__geis__v2__gesture.html#gad656ce0e800967d5e532269cb02e2190).

The documented API for determining how to classify a gesture in GEISv1 was the gesture_type argument passed to the GeisGestureCallback function (see http://developer.ubuntu.com/api/ubuntu-12.04/cplusplus/utouch-geis/group__geis__v1__subscription.html#ga26f24308473a842e39e8afa51adb4dfa).

The attribute GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME was never documented or intended as the method to classify a gesture. It is inadequate for performing that function in GEISv2, since a given gesture frame may be classified more than one way. The code would function better using one of the documented APIs instead.

Changed in utouch-geis:
status: Incomplete → Confirmed
Revision history for this message
José Expósito (jose-exposito89) wrote :

Ok Stephen, I totally agree... NOW the documentation say that.

    > "The attribute GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME
    > was never documented or intended as the method to classify
    > a gesture"

Truly, was never documented, at least in Oneiric:

    http://bazaar.launchpad.net/~utouch-packaging/utouch-geis/oneiric/view/head:/include/geis/geis.h#L241

Also the documentation for geis_frame_attr_by_name() in Oneric never says nothing about what kind of GEIS_GESTURE_ATTRIBUTE_* constants must be used and must not:

    http://bazaar.launchpad.net/~utouch-packaging/utouch-geis/oneiric/view/head:/include/geis/geis.h#L1925

To say the true, this change was documented in the revision 159 (2012-03-14)

    http://bazaar.launchpad.net/~utouch-packaging/utouch-geis/precise/revision/159#include/geis/geis.h

In addition the examples of the documentation (Oneiric and Precise) uses a similar source code:

    http://bazaar.launchpad.net/~utouch-packaging/utouch-geis/oneiric/view/head:/examples/geis2.c#L71
    http://bazaar.launchpad.net/~utouch-packaging/utouch-geis/precise/view/head:/examples/geis2.c

For this reason I think that simply the API was not well documented and is not retro-compatible with the previous specifications. This API changes in each Ubuntu version force to the developers rewrite all or parts of their applications.

Anyway, after a 2 months with this issue opened, what it is needed to get the gesture type?

    if (geis_frame_is_class(frame, ??)) { ... }

I don't see nothing to get a GeisGestureClass in the documentation (http://developer.ubuntu.com/api/ubuntu-12.04/cplusplus/utouch-geis/class_geis_gesture_class.html)

And, why the GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID, GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID and the GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID returns invalid values? As I can see in the documentation if can be used with GEIS v2:

    http://developer.ubuntu.com/api/ubuntu-12.04/cplusplus/utouch-geis/group__geis__v2__gesture.html#ga1551d50633fa2092cb75f699abb86214

Stephen M. Webb (bregma)
Changed in geis:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.