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:
parent
df228e8945
commit
6664044679
@ -3471,7 +3471,7 @@ _clutter_stage_update_state (ClutterStage *stage,
|
||||
ClutterStageState set_flags)
|
||||
{
|
||||
ClutterStageState new_state;
|
||||
ClutterEvent event;
|
||||
ClutterEvent *event;
|
||||
|
||||
new_state = stage->priv->current_state;
|
||||
new_state |= set_flags;
|
||||
@ -3480,16 +3480,16 @@ _clutter_stage_update_state (ClutterStage *stage,
|
||||
if (new_state == stage->priv->current_state)
|
||||
return FALSE;
|
||||
|
||||
memset (&event, 0, sizeof (event));
|
||||
event.type = CLUTTER_STAGE_STATE;
|
||||
clutter_event_set_stage (&event, stage);
|
||||
event = clutter_event_new (CLUTTER_STAGE_STATE);
|
||||
clutter_event_set_stage (event, stage);
|
||||
|
||||
event.stage_state.new_state = new_state;
|
||||
event.stage_state.changed_mask = new_state ^ stage->priv->current_state;
|
||||
event->stage_state.new_state = new_state;
|
||||
event->stage_state.changed_mask = new_state ^ stage->priv->current_state;
|
||||
|
||||
stage->priv->current_state = new_state;
|
||||
|
||||
clutter_stage_event (stage, &event);
|
||||
clutter_stage_event (stage, event);
|
||||
clutter_event_free (event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user