fixed immediate start animation
[livewp] / applet / src / livewp-home-widget.c
index dec4510..57aef46 100644 (file)
@@ -763,8 +763,8 @@ init_scene2(AWallpaperPlugin *desktop_plugin)
   Actor *actor;
   gint now = time(NULL);
 
-  /* fprintf(stderr, "init scene \n");*/
-  scene.daytime = get_daytime();
+  fprintf(stderr, "init scene2 \n");
+  //scene.daytime = get_daytime();
   scene.actors = NULL;
 
   
@@ -806,11 +806,7 @@ init_scene2(AWallpaperPlugin *desktop_plugin)
   actor->duration_animation = G_MAXINT;
   scene.actors = g_slist_append(scene.actors, actor);
 
-
-    
-
-
-    run_long_timeout(desktop_plugin);
+  run_long_timeout(desktop_plugin);
 }
 /* Init Modern Scene */
 static void
@@ -1358,7 +1354,8 @@ if (!desktop_plugin->priv->visible || !desktop_plugin->priv->rich_animation){
 }
 
 void
-run_long_timeout(AWallpaperPlugin *desktop_plugin){
+run_long_timeout(AWallpaperPlugin *desktop_plugin)
+{
 
     gint daytime = get_daytime();
     GSList * tmp;
@@ -1367,7 +1364,7 @@ run_long_timeout(AWallpaperPlugin *desktop_plugin){
     Actor *actor;
 
 
-    //fprintf(stderr, "timer daytime=%d\n", daytime);
+    //fprintf(stderr, "!!!run long timeout short_timer=%d\n", desktop_plugin->priv->short_timer);
     if (scene.daytime != daytime){
         scene.daytime = daytime;
         tmp = scene.actors;
@@ -1393,6 +1390,7 @@ run_long_timeout(AWallpaperPlugin *desktop_plugin){
             if (desktop_plugin->priv->rich_animation){
                 actor->time_start_animation = now;
                 desktop_plugin->priv->short_timer = g_timeout_add(SHORT_TIMER, (GtkFunction)short_timeout, desktop_plugin);
+                //fprintf(stderr, " start shor timer %d\n", desktop_plugin->priv->short_timer);
             }
             else {
                 (*actor->func_change)(actor, desktop_plugin);
@@ -1465,6 +1463,8 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     /* Load config */
     read_config(priv);
     priv->desktop_plugin = desktop_plugin;
+    priv->visible = TRUE;
+    priv->short_timer = 0;
     desktop_plugin->priv->main_widget = gtk_fixed_new();
 
     gtk_widget_set_size_request(desktop_plugin->priv->main_widget, 100, 32);
@@ -1508,7 +1508,6 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     else if (!strcmp(priv->theme, "Matrix"))
         init_scene2(desktop_plugin);
     priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
-    priv->short_timer = 0;
     /* TODO Move scene to priv */
     scene.timer_type = LONG_TIMER_TYPE;
     g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",