[clutter] stage: Process state update event immediately



commit a9f2300af1a6d15caabd3bfcdce2c998410171cf
Author: Lionel Landwerlin <lionel g landwerlin intel com>
Date:   Mon Feb 16 16:26:53 2015 +0000

    stage: Process state update event immediately
    
    The _clutter_stage_update_state() function is currently putting events
    into the Clutter event queue. This leads to problems in the gdk
    backend because there are assumptions upon the numbers of queued
    events, and how many of them should be moved from the main event queue
    to the ClutterStages' event queues.
    
    This change triggers the processing of the state update events on the
    stage directly, so the main event queue retains the expected number of
    events.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744604

 clutter/clutter-stage.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index d1ec7b4..b467b70 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -4532,7 +4532,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;
@@ -4541,15 +4541,16 @@ _clutter_stage_update_state (ClutterStage      *stage,
   if (new_state == stage->priv->current_state)
     return FALSE;
 
-  event = clutter_event_new (CLUTTER_STAGE_STATE);
-  clutter_event_set_stage (event, stage);
+  memset (&event, 0, sizeof (event));
+  event.type = 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_event_push (event, FALSE);
+  clutter_stage_event (stage, &event);
 
   return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]