diff --git a/src/main.c b/src/main.c index 9913bbccb..5e5c20751 100644 --- a/src/main.c +++ b/src/main.c @@ -39,6 +39,7 @@ extern GType gnome_shell_plugin_get_type (void); static gboolean is_gdm_mode = FALSE; static char *session_mode = NULL; static int caught_signal = 0; +static gboolean force_animations = FALSE; #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 #define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 @@ -530,6 +531,12 @@ GOptionEntry gnome_shell_options[] = { N_("List possible modes"), NULL }, + { + "force-animations", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, + &force_animations, + N_("Force animations to be enabled"), + NULL + }, { NULL } }; @@ -632,7 +639,9 @@ main (int argc, char **argv) if (session_mode == NULL) session_mode = is_gdm_mode ? (char *)"gdm" : (char *)"user"; - _shell_global_init ("session-mode", session_mode, NULL); + _shell_global_init ("session-mode", session_mode, + "force-animations", force_animations, + NULL); dump_gjs_stack_on_signal (SIGABRT); dump_gjs_stack_on_signal (SIGFPE); diff --git a/src/shell-global.c b/src/shell-global.c index 365e387f0..61742ee46 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -85,6 +85,8 @@ struct _ShellGlobal { GDBusProxy *switcheroo_control; GCancellable *switcheroo_cancellable; + + gboolean force_animations; }; enum { @@ -109,6 +111,7 @@ enum { PROP_FRAME_TIMESTAMPS, PROP_FRAME_FINISH_TIMESTAMP, PROP_SWITCHEROO_CONTROL, + PROP_FORCE_ANIMATIONS, N_PROPS }; @@ -235,6 +238,9 @@ shell_global_set_property(GObject *object, } } break; + case PROP_FORCE_ANIMATIONS: + global->force_animations = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -318,6 +324,9 @@ shell_global_get_property(GObject *object, case PROP_SWITCHEROO_CONTROL: g_value_set_object (value, global->switcheroo_control); break; + case PROP_FORCE_ANIMATIONS: + g_value_set_boolean (value, global->force_animations); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -649,6 +658,13 @@ shell_global_class_init (ShellGlobalClass *klass) G_TYPE_DBUS_PROXY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + props[PROP_FORCE_ANIMATIONS] = + g_param_spec_boolean ("force-animations", + "force-animations", + "Force animations to be enabled", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT| G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (gobject_class, N_PROPS, props); }