Merge branch 'master' of https://vcs.maemo.org/git/livewp
[livewp] / applet / src / livewp-home-widget.c
index 6537b75..4f083cb 100644 (file)
@@ -705,14 +705,17 @@ change_actor(GtkWidget * actor)
 static gboolean
 plugin_on_timeout (AWallpaperPlugin *desktop_plugin)
 {
-  gint daytime = get_daytime();
-  GSList * tmp;
-  gchar * name;
-  void (*pfunc)(gpointer, gpointer);
-  time_t now;
-  gint t;
-
-  Actor *actor;
+      gint daytime = get_daytime();
+      GSList * tmp;
+      gchar * name;
+      void (*pfunc)(gpointer, gpointer);
+      time_t now;
+      gint t;
+      Actor *actor;
+
+    /* TODO  remove timeout */
+    if (!desktop_plugin->priv->visible)
+        return TRUE;
 fprintf(stderr, "timer daytime=%d\n", daytime);
   if (scene.daytime != daytime){
       tmp = scene.actors;
@@ -814,7 +817,11 @@ desktop_plugin_visible_notify (GObject    *object,
 {
       gboolean visible;
       g_object_get (object, "is-on-current-desktop", &visible, NULL);
-      fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible);
+      if (visible)
+        desktop_plugin->priv->visible = TRUE;
+      else
+        desktop_plugin->priv->visible = FALSE;
+   /*   fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
 }
 
 static void