drop-action: Use the right state for events
The 'state' field should be used for pointer events without button information. Pointer events that have button information should use the 'button' field. https://bugzilla.gnome.org/show_bug.cgi?id=732143
This commit is contained in:
parent
acde9b1dff
commit
8d89294ef6
@ -123,23 +123,25 @@ on_stage_capture (ClutterStage *stage,
|
|||||||
gfloat event_x, event_y;
|
gfloat event_x, event_y;
|
||||||
ClutterActor *actor, *drag_actor;
|
ClutterActor *actor, *drag_actor;
|
||||||
ClutterDropAction *drop_action;
|
ClutterDropAction *drop_action;
|
||||||
|
ClutterInputDevice *device;
|
||||||
gboolean was_reactive;
|
gboolean was_reactive;
|
||||||
|
|
||||||
switch (clutter_event_type (event))
|
switch (clutter_event_type (event))
|
||||||
{
|
{
|
||||||
case CLUTTER_MOTION:
|
case CLUTTER_MOTION:
|
||||||
case CLUTTER_BUTTON_RELEASE:
|
case CLUTTER_BUTTON_RELEASE:
|
||||||
{
|
if (clutter_event_type (event) == CLUTTER_MOTION &&
|
||||||
ClutterInputDevice *device;
|
!(clutter_event_get_state (event) & CLUTTER_BUTTON1_MASK))
|
||||||
|
return CLUTTER_EVENT_PROPAGATE;
|
||||||
|
|
||||||
if (!(clutter_event_get_state (event) & CLUTTER_BUTTON1_MASK))
|
if (clutter_event_type (event) == CLUTTER_BUTTON_RELEASE &&
|
||||||
return CLUTTER_EVENT_PROPAGATE;
|
clutter_event_get_button (event) != CLUTTER_BUTTON_PRIMARY)
|
||||||
|
return CLUTTER_EVENT_PROPAGATE;
|
||||||
|
|
||||||
device = clutter_event_get_device (event);
|
device = clutter_event_get_device (event);
|
||||||
drag_actor = _clutter_stage_get_pointer_drag_actor (stage, device);
|
drag_actor = _clutter_stage_get_pointer_drag_actor (stage, device);
|
||||||
if (drag_actor == NULL)
|
if (drag_actor == NULL)
|
||||||
return CLUTTER_EVENT_PROPAGATE;
|
return CLUTTER_EVENT_PROPAGATE;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_TOUCH_UPDATE:
|
case CLUTTER_TOUCH_UPDATE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user