mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
drag-action: Remove the press event button
Both ::drag-begin and ::drag-end have a "button" argument - even though we assume internally, and externally, that dragging can only be the result of a primary button operation.
This commit is contained in:
parent
b8b2a51d44
commit
f97d16cd2d
@ -82,7 +82,6 @@ struct _ClutterDragActionPrivate
|
|||||||
gfloat press_x;
|
gfloat press_x;
|
||||||
gfloat press_y;
|
gfloat press_y;
|
||||||
ClutterModifierType press_state;
|
ClutterModifierType press_state;
|
||||||
gint press_button;
|
|
||||||
|
|
||||||
gfloat last_motion_x;
|
gfloat last_motion_x;
|
||||||
gfloat last_motion_y;
|
gfloat last_motion_y;
|
||||||
@ -131,7 +130,6 @@ emit_drag_begin (ClutterDragAction *action,
|
|||||||
g_signal_emit (action, drag_signals[DRAG_BEGIN], 0,
|
g_signal_emit (action, drag_signals[DRAG_BEGIN], 0,
|
||||||
actor,
|
actor,
|
||||||
priv->press_x, priv->press_y,
|
priv->press_x, priv->press_y,
|
||||||
priv->press_button,
|
|
||||||
priv->press_state);
|
priv->press_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +210,6 @@ emit_drag_end (ClutterDragAction *action,
|
|||||||
g_signal_emit (action, drag_signals[DRAG_END], 0,
|
g_signal_emit (action, drag_signals[DRAG_END], 0,
|
||||||
actor,
|
actor,
|
||||||
priv->last_motion_x, priv->last_motion_y,
|
priv->last_motion_x, priv->last_motion_y,
|
||||||
priv->press_button,
|
|
||||||
clutter_event_get_state (event));
|
clutter_event_get_state (event));
|
||||||
|
|
||||||
/* disconnect the capture */
|
/* disconnect the capture */
|
||||||
@ -277,11 +274,13 @@ on_button_press (ClutterActor *actor,
|
|||||||
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
|
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (clutter_event_get_button (event) != 1)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (priv->stage == NULL)
|
if (priv->stage == NULL)
|
||||||
priv->stage = clutter_actor_get_stage (actor);
|
priv->stage = clutter_actor_get_stage (actor);
|
||||||
|
|
||||||
clutter_event_get_coords (event, &priv->press_x, &priv->press_y);
|
clutter_event_get_coords (event, &priv->press_x, &priv->press_y);
|
||||||
priv->press_button = clutter_event_get_button (event);
|
|
||||||
priv->press_state = clutter_event_get_state (event);
|
priv->press_state = clutter_event_get_state (event);
|
||||||
|
|
||||||
priv->last_motion_x = priv->press_x;
|
priv->last_motion_x = priv->press_x;
|
||||||
@ -512,7 +511,6 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
|||||||
* @actor: the #ClutterActor attached to the action
|
* @actor: the #ClutterActor attached to the action
|
||||||
* @event_x: the X coordinate (in stage space) of the press event
|
* @event_x: the X coordinate (in stage space) of the press event
|
||||||
* @event_y: the Y coordinate (in stage space) of the press event
|
* @event_y: the Y coordinate (in stage space) of the press event
|
||||||
* @button: the button of the press event
|
|
||||||
* @modifiers: the modifiers of the press event
|
* @modifiers: the modifiers of the press event
|
||||||
*
|
*
|
||||||
* The ::drag-begin signal is emitted when the #ClutterDragAction
|
* The ::drag-begin signal is emitted when the #ClutterDragAction
|
||||||
@ -529,12 +527,11 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
|||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterDragActionClass, drag_begin),
|
G_STRUCT_OFFSET (ClutterDragActionClass, drag_begin),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_clutter_marshal_VOID__OBJECT_FLOAT_FLOAT_INT_FLAGS,
|
_clutter_marshal_VOID__OBJECT_FLOAT_FLOAT_FLAGS,
|
||||||
G_TYPE_NONE, 5,
|
G_TYPE_NONE, 4,
|
||||||
CLUTTER_TYPE_ACTOR,
|
CLUTTER_TYPE_ACTOR,
|
||||||
G_TYPE_FLOAT,
|
G_TYPE_FLOAT,
|
||||||
G_TYPE_FLOAT,
|
G_TYPE_FLOAT,
|
||||||
G_TYPE_INT,
|
|
||||||
CLUTTER_TYPE_MODIFIER_TYPE);
|
CLUTTER_TYPE_MODIFIER_TYPE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -584,7 +581,6 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
|||||||
* @actor: the #ClutterActor attached to the action
|
* @actor: the #ClutterActor attached to the action
|
||||||
* @event_x: the X coordinate (in stage space) of the release event
|
* @event_x: the X coordinate (in stage space) of the release event
|
||||||
* @event_y: the Y coordinate (in stage space) of the release event
|
* @event_y: the Y coordinate (in stage space) of the release event
|
||||||
* @button: the button of the release event
|
|
||||||
* @modifiers: the modifiers of the release event
|
* @modifiers: the modifiers of the release event
|
||||||
*
|
*
|
||||||
* The ::drag-end signal is emitted at the end of the dragging,
|
* The ::drag-end signal is emitted at the end of the dragging,
|
||||||
@ -601,12 +597,11 @@ clutter_drag_action_class_init (ClutterDragActionClass *klass)
|
|||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
G_STRUCT_OFFSET (ClutterDragActionClass, drag_end),
|
G_STRUCT_OFFSET (ClutterDragActionClass, drag_end),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_clutter_marshal_VOID__OBJECT_FLOAT_FLOAT_INT_FLAGS,
|
_clutter_marshal_VOID__OBJECT_FLOAT_FLOAT_FLAGS,
|
||||||
G_TYPE_NONE, 5,
|
G_TYPE_NONE, 4,
|
||||||
CLUTTER_TYPE_ACTOR,
|
CLUTTER_TYPE_ACTOR,
|
||||||
G_TYPE_FLOAT,
|
G_TYPE_FLOAT,
|
||||||
G_TYPE_FLOAT,
|
G_TYPE_FLOAT,
|
||||||
G_TYPE_INT,
|
|
||||||
CLUTTER_TYPE_MODIFIER_TYPE);
|
CLUTTER_TYPE_MODIFIER_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,6 @@ struct _ClutterDragActionClass
|
|||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
gfloat event_x,
|
gfloat event_x,
|
||||||
gfloat event_y,
|
gfloat event_y,
|
||||||
gint button,
|
|
||||||
ClutterModifierType modifiers);
|
ClutterModifierType modifiers);
|
||||||
void (* drag_motion) (ClutterDragAction *action,
|
void (* drag_motion) (ClutterDragAction *action,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
@ -110,7 +109,6 @@ struct _ClutterDragActionClass
|
|||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
gfloat event_x,
|
gfloat event_x,
|
||||||
gfloat event_y,
|
gfloat event_y,
|
||||||
gint button,
|
|
||||||
ClutterModifierType modifiers);
|
ClutterModifierType modifiers);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
@ -11,7 +11,7 @@ VOID:FLOAT,FLOAT
|
|||||||
VOID:INT,INT,INT,INT
|
VOID:INT,INT,INT,INT
|
||||||
VOID:OBJECT
|
VOID:OBJECT
|
||||||
VOID:OBJECT,FLOAT,FLOAT
|
VOID:OBJECT,FLOAT,FLOAT
|
||||||
VOID:OBJECT,FLOAT,FLOAT,INT,FLAGS
|
VOID:OBJECT,FLOAT,FLOAT,FLAGS
|
||||||
VOID:OBJECT,OBJECT,PARAM
|
VOID:OBJECT,OBJECT,PARAM
|
||||||
VOID:OBJECT,POINTER
|
VOID:OBJECT,POINTER
|
||||||
VOID:POINTER
|
VOID:POINTER
|
||||||
|
@ -29,7 +29,6 @@ on_drag_begin (ClutterDragAction *action,
|
|||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
gfloat event_x,
|
gfloat event_x,
|
||||||
gfloat event_y,
|
gfloat event_y,
|
||||||
gint button,
|
|
||||||
ClutterModifierType modifiers)
|
ClutterModifierType modifiers)
|
||||||
{
|
{
|
||||||
gboolean is_copy = (modifiers & CLUTTER_SHIFT_MASK) ? TRUE : FALSE;
|
gboolean is_copy = (modifiers & CLUTTER_SHIFT_MASK) ? TRUE : FALSE;
|
||||||
@ -65,7 +64,6 @@ on_drag_end (ClutterDragAction *action,
|
|||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
gfloat event_x,
|
gfloat event_x,
|
||||||
gfloat event_y,
|
gfloat event_y,
|
||||||
gint button,
|
|
||||||
ClutterModifierType modifiers)
|
ClutterModifierType modifiers)
|
||||||
{
|
{
|
||||||
ClutterActor *drag_handle;
|
ClutterActor *drag_handle;
|
||||||
|
@ -25,7 +25,6 @@ on_drag_end (ClutterDragAction *action,
|
|||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
gfloat event_x,
|
gfloat event_x,
|
||||||
gfloat event_y,
|
gfloat event_y,
|
||||||
guint button,
|
|
||||||
ClutterModifierType modifiers)
|
ClutterModifierType modifiers)
|
||||||
{
|
{
|
||||||
gfloat viewport_x = clutter_actor_get_x (viewport);
|
gfloat viewport_x = clutter_actor_get_x (viewport);
|
||||||
|
Loading…
Reference in New Issue
Block a user