clutter: Drop ClutterStage field from ClutterEvent

Avoid setting in ClutterEvents the stage they will end up
delivered through. This is now handled explicitly where it
matters.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
Carlos Garnacho 2023-08-02 21:00:33 +02:00
parent 1f9e787b83
commit c341bf5af9
3 changed files with 2 additions and 61 deletions

View File

@ -530,43 +530,6 @@ clutter_event_set_source (ClutterEvent *event,
{
}
/**
* clutter_event_get_stage:
* @event: a #ClutterEvent
*
* Retrieves the source #ClutterStage the event originated for, or
* %NULL if the event has no stage.
*
* Return value: (transfer none): a #ClutterStage
*/
ClutterStage *
clutter_event_get_stage (const ClutterEvent *event)
{
g_return_val_if_fail (event != NULL, NULL);
return event->any.stage;
}
/**
* clutter_event_set_stage:
* @event: a #ClutterEvent
* @stage: (allow-none): a #ClutterStage, or %NULL
*
* Sets the source #ClutterStage of the event.
*/
void
clutter_event_set_stage (ClutterEvent *event,
ClutterStage *stage)
{
g_return_if_fail (event != NULL);
g_return_if_fail (stage == NULL || CLUTTER_IS_STAGE (stage));
if (event->any.stage == stage)
return;
event->any.stage = stage;
}
/**
* clutter_event_get_flags:
* @event: a #ClutterEvent
@ -1685,7 +1648,8 @@ _clutter_event_process_filters (ClutterEvent *event,
next = l->next;
if (event_filter->stage && event_filter->stage != event->any.stage)
if (event_filter->stage &&
event_filter->stage != CLUTTER_STAGE (clutter_actor_get_stage (event_actor)))
continue;
if (event_filter->func (event, event_actor, event_filter->user_data) == CLUTTER_EVENT_STOP)

View File

@ -123,7 +123,6 @@ struct _ClutterAnyEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
};
/**
@ -147,7 +146,6 @@ struct _ClutterKeyEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterModifierType modifier_state;
guint keyval;
@ -183,7 +181,6 @@ struct _ClutterButtonEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
gfloat x;
gfloat y;
@ -211,7 +208,6 @@ struct _ClutterProximityEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterInputDevice *device;
};
@ -235,7 +231,6 @@ struct _ClutterCrossingEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
gfloat x;
gfloat y;
@ -266,7 +261,6 @@ struct _ClutterMotionEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
gfloat x;
gfloat y;
@ -307,7 +301,6 @@ struct _ClutterScrollEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
gfloat x;
gfloat y;
@ -354,7 +347,6 @@ struct _ClutterTouchEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
gfloat x;
gfloat y;
@ -398,7 +390,6 @@ struct _ClutterTouchpadPinchEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterTouchpadGesturePhase phase;
gfloat x;
@ -439,7 +430,6 @@ struct _ClutterTouchpadSwipeEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterTouchpadGesturePhase phase;
guint n_fingers;
@ -479,7 +469,6 @@ struct _ClutterTouchpadHoldEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterTouchpadGesturePhase phase;
uint32_t n_fingers;
@ -492,7 +481,6 @@ struct _ClutterPadButtonEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
guint32 button;
guint32 group;
@ -505,7 +493,6 @@ struct _ClutterPadStripEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterInputDevice *device;
ClutterInputDevicePadSource strip_source;
@ -520,7 +507,6 @@ struct _ClutterPadRingEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterInputDevice *device;
ClutterInputDevicePadSource ring_source;
@ -535,7 +521,6 @@ struct _ClutterDeviceEvent
ClutterEventType type;
guint32 time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterInputDevice *device;
};
@ -545,7 +530,6 @@ struct _ClutterIMEvent
ClutterEventType type;
uint32_t time;
ClutterEventFlags flags;
ClutterStage *stage;
char *text;
int32_t offset;
@ -679,11 +663,6 @@ void clutter_event_set_source (ClutterEvent
CLUTTER_DEPRECATED
ClutterActor * clutter_event_get_source (const ClutterEvent *event);
CLUTTER_EXPORT
void clutter_event_set_stage (ClutterEvent *event,
ClutterStage *stage);
CLUTTER_EXPORT
ClutterStage * clutter_event_get_stage (const ClutterEvent *event);
CLUTTER_EXPORT
ClutterInputDeviceType clutter_event_get_device_type (const ClutterEvent *event);
CLUTTER_EXPORT
void clutter_event_set_coords (ClutterEvent *event,

View File

@ -781,8 +781,6 @@ clutter_stage_handle_event (ClutterStage *stage,
g_return_if_fail (CLUTTER_IS_STAGE (stage));
g_return_if_fail (event != NULL);
clutter_event_set_stage (event, stage);
/* stages in destruction do not process events */
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return;