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
This commit is contained in:
Lionel Landwerlin 2015-02-16 16:26:53 +00:00
parent 344e13844d
commit a9f2300af1

View File

@ -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;
}