From: vlad Date: Thu, 29 Jul 2010 19:51:28 +0000 (+0300) Subject: almost done xsnow theme X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=8fe8345165d74294a685f0b3078a089d4c4b7dc1;p=livewp almost done xsnow theme --- diff --git a/applet/src/livewp-common.h b/applet/src/livewp-common.h index 122ca68..31d2699 100644 --- a/applet/src/livewp-common.h +++ b/applet/src/livewp-common.h @@ -105,6 +105,7 @@ struct _Animation_WallpaperPrivate time_t last_alive_event; gchar *theme_string_parametr1; GstElement *pipeline; + gboolean running; }; struct _AWallpaperPlugin diff --git a/applet/src/livewp-home-widget.c b/applet/src/livewp-home-widget.c index e3a13e6..03277f9 100644 --- a/applet/src/livewp-home-widget.c +++ b/applet/src/livewp-home-widget.c @@ -49,6 +49,7 @@ lw_applet_realize (GtkWidget *widget) strid = g_strdup(hd_plugin_item_get_plugin_id (HD_PLUGIN_ITEM (widget))); + id = strid[strlen(strid)-1] - '0'; desktop_plugin->priv->view = id; g_free(strid); @@ -69,6 +70,8 @@ lw_applet_realize (GtkWidget *widget) execvp("/usr/bin/livewp", child_argv); fprintf(stderr,"Problem with new process"); } + fprintf(stderr,"dssssssddddddddddddddddddd\n"); + desktop_plugin_visible_notify(widget, NULL, desktop_plugin->priv); #if 0 /* Load config */ read_config(desktop_plugin->priv); @@ -429,7 +432,7 @@ long_timeout (AWallpaperPlugin *desktop_plugin) return TRUE; /* keep running this event */ } -static void +void desktop_plugin_visible_notify (GObject *object, GParamSpec *spec, AWallpaperPlugin *desktop_plugin) diff --git a/applet/src/livewp-home-widget.h b/applet/src/livewp-home-widget.h index dfcad0f..531557c 100644 --- a/applet/src/livewp-home-widget.h +++ b/applet/src/livewp-home-widget.h @@ -78,4 +78,6 @@ void livewp_initialize_dbus(Animation_WallpaperPrivate *priv); void livewp_deinitialize_dbus(Animation_WallpaperPrivate *priv); gint current_active_view(void); gboolean long_timeout (AWallpaperPlugin *desktop_plugin); +void desktop_plugin_visible_notify (GObject *object, GParamSpec *spec, AWallpaperPlugin *desktop_plugin); + #endif diff --git a/applet/src/livewp-main.c b/applet/src/livewp-main.c index 6c9aed1..2cbd87a 100644 --- a/applet/src/livewp-main.c +++ b/applet/src/livewp-main.c @@ -70,6 +70,11 @@ void view_state_changed (Animation_WallpaperPrivate *priv) { if (priv->visible){ + if (!priv->running){ + if (!strcmp(priv->theme, "Xsnow")){ + init_scene_Xsnow(priv->desktop_plugin); + } + } if (priv->pipeline) gst_element_set_state (priv->pipeline, GST_STATE_PLAYING); if (priv->long_timer == 0 ){ @@ -134,7 +139,6 @@ quit_from_program (Animation_WallpaperPrivate *priv) priv->short_timer = 0; } destroy_scene(priv->desktop_plugin); - fprintf(stderr, "PID %i\n", priv->podpid); if (priv->podpid > 1) kill (priv->podpid, SIGTERM); @@ -202,6 +206,7 @@ main(int argc, char *argv[]) priv->scene = NULL; priv->pipeline = NULL; priv->podpid = -1; + priv->running = FALSE; priv->window = main_widget; fprintf(stderr,"XWINDOW %i\n",GDK_WINDOW_XID (main_widget->window)); priv->desktop_plugin = desktop_plugin; diff --git a/applet/src/livewp-scene.c b/applet/src/livewp-scene.c index 122e21c..e6d7d8d 100644 --- a/applet/src/livewp-scene.c +++ b/applet/src/livewp-scene.c @@ -176,9 +176,12 @@ init_scene_Xsnow(AWallpaperPlugin *desktop_plugin){ // fprintf(stderr, "PARAMETR %s\n", desktop_plugin->priv->theme_string_parametr1); // run_string = g_strdup_printf("/usr/bin/mplayer -vo x11 -wid %d %s\n", \ GDK_WINDOW_XID(desktop_plugin->priv->window->window), desktop_plugin->priv->theme_string_parametr1); + if (!desktop_plugin->priv->visible) + return; run_string= g_strdup_printf("/usr/bin/xsnow"); parsestring(run_string, child_argv); + desktop_plugin->priv->running = TRUE; desktop_plugin->priv->podpid = fork(); if (desktop_plugin->priv->podpid == 0){ execvp("/usr/bin/xsnow", child_argv);