Example #1
0
static VALUE
rbclt_stage_event (VALUE self, VALUE event_arg)
{
  ClutterStage *stage = CLUTTER_STAGE (RVAL2GOBJ (self));
  ClutterEvent *event = (ClutterEvent *) RVAL2BOXED (event_arg,
                                                     CLUTTER_TYPE_EVENT);

  clutter_stage_event (stage, event);

  return self;
}
Example #2
0
void
meta_stage_set_active (MetaStage *stage,
                       gboolean   is_active)
{
  MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
  ClutterEvent event = { 0 };

  /* Used by the native backend to inform accessibility technologies
   * about when the stage loses and gains input focus.
   *
   * For the X11 backend, clutter transparently takes care of this
   * for us.
   */

  if (priv->is_active == is_active)
    return;

  event.type = CLUTTER_STAGE_STATE;
  clutter_event_set_stage (&event, CLUTTER_STAGE (stage));
  event.stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED;

  if (is_active)
    event.stage_state.new_state = CLUTTER_STAGE_STATE_ACTIVATED;

  /* Emitting this StageState event will result in the stage getting
   * activated or deactivated (with the activated or deactivated signal
   * getting emitted from the stage)
   *
   * FIXME: This won't update ClutterStage's own notion of its
   * activeness. For that we would need to somehow trigger a
   * _clutter_stage_update_state call, which will probably
   * require new API in clutter. In practice, nothing relies
   * on the ClutterStage's own notion of activeness when using
   * the EGL backend.
   *
   * See http://bugzilla.gnome.org/746670
   */
  clutter_stage_event (CLUTTER_STAGE (stage), &event);
}