@ -121,21 +121,25 @@ evdev_flush_pending_event(struct evdev_device *device, uint32_t time)
notify_touch ( master , time , slot , 0 , 0 ,
notify_touch ( master , time , slot , 0 , 0 ,
WL_TOUCH_UP ) ;
WL_TOUCH_UP ) ;
goto handled ;
goto handled ;
case EVDEV_ABSOLUTE_TOUCH_DOWN :
transform_absolute ( device , & cx , & cy ) ;
weston_output_transform_coordinate ( device - > output ,
cx , cy , & x , & y ) ;
notify_touch ( master , time , 0 , x , y , WL_TOUCH_DOWN ) ;
goto handled ;
case EVDEV_ABSOLUTE_MOTION :
case EVDEV_ABSOLUTE_MOTION :
transform_absolute ( device , & cx , & cy ) ;
transform_absolute ( device , & cx , & cy ) ;
weston_output_transform_coordinate ( device - > output ,
weston_output_transform_coordinate ( device - > output ,
cx , cy , & x , & y ) ;
cx , cy , & x , & y ) ;
if ( device - > caps & EVDEV_TOUCH ) {
if ( device - > caps & EVDEV_TOUCH )
if ( master - > num_tp = = 0 )
notify_touch ( master , time , 0 , x , y , WL_TOUCH_MOTION ) ;
notify_touch ( master , time , 0 ,
else
x , y , WL_TOUCH_DOWN ) ;
else
notify_touch ( master , time , 0 ,
x , y , WL_TOUCH_MOTION ) ;
} else
notify_motion_absolute ( master , time , x , y ) ;
notify_motion_absolute ( master , time , x , y ) ;
goto handled ;
goto handled ;
case EVDEV_ABSOLUTE_TOUCH_UP :
notify_touch ( master , time , 0 , 0 , 0 , WL_TOUCH_UP ) ;
goto handled ;
}
}
assert ( 0 & & " Unknown pending event type " ) ;
assert ( 0 & & " Unknown pending event type " ) ;
@ -144,6 +148,18 @@ handled:
device - > pending_event = EVDEV_NONE ;
device - > pending_event = EVDEV_NONE ;
}
}
static void
evdev_process_touch_button ( struct evdev_device * device , int time , int value )
{
if ( device - > pending_event ! = EVDEV_NONE & &
device - > pending_event ! = EVDEV_ABSOLUTE_MOTION )
evdev_flush_pending_event ( device , time ) ;
device - > pending_event = ( value ?
EVDEV_ABSOLUTE_TOUCH_DOWN :
EVDEV_ABSOLUTE_TOUCH_UP ) ;
}
static inline void
static inline void
evdev_process_key ( struct evdev_device * device , struct input_event * e , int time )
evdev_process_key ( struct evdev_device * device , struct input_event * e , int time )
{
{
@ -151,6 +167,12 @@ evdev_process_key(struct evdev_device *device, struct input_event *e, int time)
if ( e - > value = = 2 )
if ( e - > value = = 2 )
return ;
return ;
if ( e - > code = = BTN_TOUCH ) {
if ( ! device - > is_mt )
evdev_process_touch_button ( device , time , e - > value ) ;
return ;
}
evdev_flush_pending_event ( device , time ) ;
evdev_flush_pending_event ( device , time ) ;
switch ( e - > code ) {
switch ( e - > code ) {
@ -168,11 +190,6 @@ evdev_process_key(struct evdev_device *device, struct input_event *e, int time)
WL_POINTER_BUTTON_STATE_RELEASED ) ;
WL_POINTER_BUTTON_STATE_RELEASED ) ;
break ;
break ;
case BTN_TOUCH :
if ( e - > value = = 0 & & ! device - > is_mt )
notify_touch ( device - > seat , time , 0 , 0 , 0 ,
WL_TOUCH_UP ) ;
break ;
default :
default :
notify_key ( device - > seat ,
notify_key ( device - > seat ,
time , e - > code ,
time , e - > code ,