mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
clutter/main: Remote global motion event handling
Clutter has two motion event toggles: one in the global context, and one per stage. The global one is deprecated, and currently unused. Remove the global motion event handling. https://gitlab.gnome.org/GNOME/mutter/merge_requests/666
This commit is contained in:
parent
5bd85ef7e5
commit
ad220fc025
@ -472,67 +472,6 @@ clutter_redraw (ClutterStage *stage)
|
||||
clutter_stage_ensure_redraw (stage);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_motion_events_enabled:
|
||||
* @enable: %TRUE to enable per-actor motion events
|
||||
*
|
||||
* Sets whether per-actor motion events should be enabled or not on
|
||||
* all #ClutterStage<!-- -->s managed by Clutter.
|
||||
*
|
||||
* If @enable is %FALSE the following events will not work:
|
||||
*
|
||||
* - ClutterActor::motion-event, except on the #ClutterStage
|
||||
* - ClutterActor::enter-event
|
||||
* - ClutterActor::leave-event
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_stage_set_motion_events_enabled() instead.
|
||||
*/
|
||||
void
|
||||
clutter_set_motion_events_enabled (gboolean enable)
|
||||
{
|
||||
ClutterStageManager *stage_manager;
|
||||
ClutterMainContext *context;
|
||||
const GSList *l;
|
||||
|
||||
enable = !!enable;
|
||||
|
||||
context = _clutter_context_get_default ();
|
||||
if (context->motion_events_per_actor == enable)
|
||||
return;
|
||||
|
||||
/* store the flag for later query and for newly created stages */
|
||||
context->motion_events_per_actor = enable;
|
||||
|
||||
/* propagate the change to all stages */
|
||||
stage_manager = clutter_stage_manager_get_default ();
|
||||
|
||||
for (l = clutter_stage_manager_peek_stages (stage_manager);
|
||||
l != NULL;
|
||||
l = l->next)
|
||||
{
|
||||
clutter_stage_set_motion_events_enabled (l->data, enable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_motion_events_enabled:
|
||||
*
|
||||
* Gets whether the per-actor motion events are enabled.
|
||||
*
|
||||
* Return value: %TRUE if the motion events are enabled
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_stage_get_motion_events_enabled() instead.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_motion_events_enabled (void)
|
||||
{
|
||||
return _clutter_context_get_motion_events_enabled ();
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_id_to_color (guint id_,
|
||||
ClutterColor *col)
|
||||
@ -1205,7 +1144,6 @@ clutter_context_get_default_unlocked (void)
|
||||
ctx->settings = clutter_settings_get_default ();
|
||||
_clutter_settings_set_backend (ctx->settings, ctx->backend);
|
||||
|
||||
ctx->motion_events_per_actor = TRUE;
|
||||
ctx->last_repaint_id = 1;
|
||||
}
|
||||
|
||||
@ -3577,14 +3515,6 @@ _clutter_context_get_pick_mode (void)
|
||||
return context->pick_mode;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_context_get_motion_events_enabled (void)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
return context->motion_events_per_actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_check_windowing_backend:
|
||||
* @backend_type: the name of the backend to check
|
||||
|
@ -170,7 +170,6 @@ struct _ClutterMainContext
|
||||
|
||||
/* boolean flags */
|
||||
guint is_initialized : 1;
|
||||
guint motion_events_per_actor : 1;
|
||||
guint defer_display_setup : 1;
|
||||
guint options_parsed : 1;
|
||||
guint show_fps : 1;
|
||||
@ -195,7 +194,6 @@ void _clutter_context_lock (void);
|
||||
void _clutter_context_unlock (void);
|
||||
gboolean _clutter_context_is_initialized (void);
|
||||
ClutterPickMode _clutter_context_get_pick_mode (void);
|
||||
gboolean _clutter_context_get_motion_events_enabled (void);
|
||||
gboolean _clutter_context_get_show_fps (void);
|
||||
|
||||
gboolean _clutter_feature_init (GError **error);
|
||||
|
@ -2240,14 +2240,7 @@ clutter_stage_init (ClutterStage *self)
|
||||
priv->throttle_motion_events = TRUE;
|
||||
priv->min_size_changed = FALSE;
|
||||
priv->sync_delay = -1;
|
||||
|
||||
/* XXX - we need to keep the invariant that calling
|
||||
* clutter_set_motion_event_enabled() before the stage creation
|
||||
* will cause motion event delivery to be disabled on any newly
|
||||
* created stage. this can go away when we break API and remove
|
||||
* deprecated functions.
|
||||
*/
|
||||
priv->motion_events_enabled = _clutter_context_get_motion_events_enabled ();
|
||||
priv->motion_events_enabled = TRUE;
|
||||
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (self),
|
||||
&default_stage_color);
|
||||
|
@ -40,12 +40,6 @@ void clutter_threads_enter (void);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_leave (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled)
|
||||
void clutter_set_motion_events_enabled (gboolean enable);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_get_motion_events_enabled)
|
||||
gboolean clutter_get_motion_events_enabled (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_ensure_redraw)
|
||||
void clutter_redraw (ClutterStage *stage);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user