clutter: Do not use stack-allocated ClutterEvents

Use ClutterEvent* and clutter_event_new() to always allocate events.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
This commit is contained in:
Carlos Garnacho 2020-09-24 17:21:18 +02:00
parent df228e8945
commit 6664044679

View File

@ -3471,7 +3471,7 @@ _clutter_stage_update_state (ClutterStage *stage,
ClutterStageState set_flags) ClutterStageState set_flags)
{ {
ClutterStageState new_state; ClutterStageState new_state;
ClutterEvent event; ClutterEvent *event;
new_state = stage->priv->current_state; new_state = stage->priv->current_state;
new_state |= set_flags; new_state |= set_flags;
@ -3480,16 +3480,16 @@ _clutter_stage_update_state (ClutterStage *stage,
if (new_state == stage->priv->current_state) if (new_state == stage->priv->current_state)
return FALSE; return FALSE;
memset (&event, 0, sizeof (event)); event = clutter_event_new (CLUTTER_STAGE_STATE);
event.type = CLUTTER_STAGE_STATE; clutter_event_set_stage (event, stage);
clutter_event_set_stage (&event, stage);
event.stage_state.new_state = new_state; event->stage_state.new_state = new_state;
event.stage_state.changed_mask = new_state ^ stage->priv->current_state; event->stage_state.changed_mask = new_state ^ stage->priv->current_state;
stage->priv->current_state = new_state; stage->priv->current_state = new_state;
clutter_stage_event (stage, &event); clutter_stage_event (stage, event);
clutter_event_free (event);
return TRUE; return TRUE;
} }