[mutter/wip/carlosg/input-thread: 2/6] clutter: Do not use stack-allocated ClutterEvents
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 2/6] clutter: Do not use stack-allocated ClutterEvents
- Date: Sat, 26 Sep 2020 15:47:46 +0000 (UTC)
commit a3b28656e2849a3ab5ecc25a482101638a68a226
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Sep 24 17:21:18 2020 +0200
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/1403
clutter/clutter/clutter-stage.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index eaadc46de4..d6fdbd52d6 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -3451,7 +3451,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;
@@ -3460,16 +3460,15 @@ _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);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]