Hi,

 

I have several opinions about the code.


1. This can be hardware-dependent code.

There are two or more types Linux MT protocol. (You can see here
<http://www.google.co.kr/url?q=http://www.mjmwired.net/kernel/Documentation/
input/multi-touch-protocol.txt&sa=U&ei=BaV5Tqr5O-
3UmAWYhInLAQ&ved=0CBAQFjAA&sig2=U9xA2Bo40_i6yfBqEBgwLw&usg=AFQjCNFe7mFV5heDy
IKS3IGHzr-0GFJ_eA> .)

Protocol A, B and so on.

 

In system whose kernel uses MT protocol A, ABS_MT_TRACKING_ID event won’t
be made.

Then _ecore_mouse_move() won’t be called in _ecore_x_input_handler() in
your patch.


2. As you mentioned earlier in your mail, event for the first finger will
be made twice.

When you move with the first finger, it makes MotionNotify and
XI_MotionNotify for the same finger.
Both events must be made and transferred via wire by Xserver at the same
time.

This can make overheads for transferring both X event and XI event between
Xserver and application for the first finger.

Besides in evas multi_down and multi_move callback, application must check
deviceid everytime.



Multitouch device can be configured on X system in some ways.

(1) Each finger can be configured as an XISlavePointer attached to a master
pointer.

(2) Each finger can also be configured as an XIFloatingSlave.

(3) One finger can be configured as an XISlavePointer and the others can be
XIFloatingSlave.

I’d like to recommend that you take 3rd configuration in the above ways.

 

First finger makes only X events as SlavePointer device.

The other fingers make XI events as FloatingSlave device.

Currently, ecore and evas code based on this configuration.

Application gets mouse event as the first finger and gets multi events as
the other fingers.

Is there any difficulty to use the 3rd configuration in your platform ?

 

If you didn’t float 2nd/3rd finger from master pointer, the fingers will
make X events such as ButtonPress/ButtonRelease/MotionNotify.

For example, in a list widget in an application just gets X events, 2nd/3rd
finger’s movement will be affected.

How about your opinions ?

 

Best regards,

Sung-Jin Park

 

P.S. I attached major code contains your patch as a reference.

 

void

_ecore_x_input_handler(XEvent *xevent)

{

#ifdef ECORE_XI2

   XIDeviceEvent *evd = (XIDeviceEvent *)(xevent->xcookie.data);

   int devid = evd->deviceid;

   XIDeviceInfo *dev = NULL;

   int i = 0;

 

   /* Get XIDeviceInfo structure */

   for (i = 0; i < _ecore_x_xi2_num; i++)

        if (devid == _ecore_x_xi2_devs[i].deviceid)

          {

             dev = &(_ecore_x_xi2_devs[i]);

             break;

          }

 

   for (i = 0; i < dev->num_classes; ++i) {

        XIAnyClassInfo *classinfo = dev->classes[i];

        if (classinfo && classinfo->type == XIValuatorClass ) {

             XIValuatorClassInfo *valuatorclassinfo =
(XIValuatorClassInfo*)classinfo;

             int n = valuatorclassinfo->number;

             double x, y, winx, winy;

 

             if (!XIMaskIsSet(evd->valuators.mask, n))

               continue;

             /*           printf("Valuator %d, class %d, atom = (%d), val =
%f\n", n, i,

                          valuatorclassinfo->label, evd-
>valuators.values[n]);

             */

             if(valuatorclassinfo->label == atom_labels[AbsMTPositionX]) {

                  /* Convert to screen coordinates. Only works in a one-
screen

                   * setup */

                 x = (evd->valuators.values[n] - valuatorclassinfo->min) /
(valuatorclassinfo->max - valuatorclassinfo->min)*

                         WidthOfScreen(DefaultScreenOfDisplay(xevent-
>xcookie.display));

                 winx = x + evd->event_x - evd->root_x;

 

             }

             else if(valuatorclassinfo->label ==
atom_labels[AbsMTPositionY]) {

                 y = (evd->valuators.values[n] - valuatorclassinfo->min) /
(valuatorclassinfo->max - valuatorclassinfo->min)*

                         HeightOfScreen(DefaultScreenOfDisplay(xevent-
>xcookie.display));

                 winy = y + evd->event_y - evd->root_y;

             }

             else if(valuatorclassinfo->label ==
atom_labels[AbsMTTrackingID]) 

                 {

                 int trackingid = (int)evd->valuators.values[n];

 

                 if(winx < 0 || winy < 0 )

                         continue;

 

                  printf("Finger : %d, x = %05.1f, y = %05.1f, rootx =
%05.1f, rooty = %05.1f\n",

                        trackingid, winx, winy, x, y);

 

                  switch (xevent->xcookie.evtype)

                    {

                     case XI_Motion:

                        _ecore_mouse_move

                           (evd->time,

                            0, // state

                           winx, winy,

                            x, y,

                            evd->event,

                            (evd->child ? evd->child : evd->event),

                            evd->root,

                            1, // same_screen

                            devid+trackingid, 1, 1,

                            1.0, // pressure

                            0.0, // angle

                           winx, winy,

                            x, y);

                        break;

 

                     case XI_ButtonPress:

                        _ecore_mouse_button

                           (ECORE_EVENT_MOUSE_BUTTON_DOWN,

                            evd->time,

                            0, // state

                            0, // button

                           winx, winy,

                            x, y,

                            evd->event,

                            (evd->child ? evd->child : evd->event),

                            evd->root,

                            1, // same_screen

                            devid+trackingid, 1, 1,

                            1.0, // pressure

                            0.0, // angle

                           winx, winy,

                            x, y);

                        break;

 

                     case XI_ButtonRelease:

                        _ecore_mouse_button

                           (ECORE_EVENT_MOUSE_BUTTON_UP,

                            evd->time,

                            0, // state

                            0, // button

                           winx, winy,

                            x, y,

                            evd->event,

                            (evd->child ? evd->child : evd->event),

                            evd->root,

                            1, // same_screen

                            devid+trackingid, 1, 1,

                            1.0, // pressure

                            0.0, // angle

                           winx, winy,

                            x, y);

                        break;

                    } /* switch */

                 } /* is trackingid*/

        } /* if valuator*/

   } /* for loop on classes */

#endif /* ifdef ECORE_XI2 */

} /* _ecore_x_input_handler */

 

EAPI Eina_Bool

ecore_x_input_multi_select(Ecore_X_Window win)

{

#ifdef ECORE_XI2

   int i;

   Eina_Bool find = EINA_FALSE;

 

   if (!_ecore_x_xi2_devs)

      return 0;

 

   LOGFN(__FILE__, __LINE__, __FUNCTION__);

   for (i = 0; i < _ecore_x_xi2_num; i++)

     {

        XIDeviceInfo *dev = &(_ecore_x_xi2_devs[i]);

 

       DBG("Now selected on dev %d, deviceid %d, use = %d, float = %d\n",

           i, dev->deviceid, dev->use, XIFloatingSlave);

        if (dev->use == XIFloatingSlave || dev->use == XISlavePointer)

          {

             XIEventMask eventmask;

             unsigned char mask[1] = { 0 };

 

             eventmask.deviceid = dev->deviceid;

             eventmask.mask_len = sizeof(mask);

             eventmask.mask = mask;

             XISetMask(mask, XI_ButtonPress);

             XISetMask(mask, XI_ButtonRelease);

             XISetMask(mask, XI_Motion);

             XISelectEvents(_ecore_x_disp, win, &eventmask, 1);

             find = EINA_TRUE;

          }

     }

 

   return find;

#else /* ifdef ECORE_XI2 */

   return EINA_FALSE;

#endif /* ifdef ECORE_XI2 */

} /* ecore_x_input_multi_select */

 

 

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to