gchar * strid;
gint id;
AWallpaperPlugin *desktop_plugin = widget;
+ pid_t pid;
+ char* child_argv[] = {"/usr/bin/livewp", "0", (char *) 0 };
+
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);
+ fprintf(stderr,"ID !!!!!!!!!! %i\n",id);
+
+ switch (id){
+ case 0: child_argv[1] = "0";
+ break;
+ case 1: child_argv[1] = "1";
+ break;
+ case 2: child_argv[1] = "2";
+ break;
+ case 3: child_argv[1] = "3";
+ break;
+ }
+ fprintf(stderr,"New proceess !!!!!!!!!! %s\n",child_argv[0]);
+ fprintf(stderr,"New proceess !!!!!!!!!! %s\n",child_argv[1]);
+ pid = fork();
+ if (pid == 0){
+ fprintf(stderr,"New proceess !!!!!!!!!! %s\n",child_argv[1]);
+ execvp("/usr/bin/livewp", child_argv);
+ fprintf(stderr,"Problem with new process");
+ }
+#if 0
/* Load config */
read_config(desktop_plugin->priv);
init_scene_theme(desktop_plugin);
desktop_plugin->priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
-
+#endif
screen = gtk_widget_get_screen (widget);
gtk_widget_set_colormap (widget,
gdk_screen_get_rgba_colormap (screen));
lw_applet_finalize (GObject *object)
{
fprintf(stderr,"lw_applet_finalize\n");
-/*
AWallpaperPlugin *desktop_plugin = Animation_Wallpaper_HOME_PLUGIN (object);
Animation_WallpaperPrivate *priv = desktop_plugin->priv;
+/*
if (priv){
livewp_deinitialize_dbus(priv);
destroy_scene(desktop_plugin);
}
-*/
+*/
+
+ if (priv){
+ livewp_deinitialize_dbus(priv);
+ switch (priv->view){
+ case 0: send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
+ LIVEWP_SIGNAL_PATH, LIVEWP_STOP_LIVEBG_ON_VIEW0);
+ break;
+ case 1: send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
+ LIVEWP_SIGNAL_PATH, LIVEWP_STOP_LIVEBG_ON_VIEW1);
+ break;
+ case 2: send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
+ LIVEWP_SIGNAL_PATH, LIVEWP_STOP_LIVEBG_ON_VIEW2);
+ break;
+ case 3: send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
+ LIVEWP_SIGNAL_PATH, LIVEWP_STOP_LIVEBG_ON_VIEW3);
+ break;
+ }
+ }
+
}
static void
AWallpaperPlugin *desktop_plugin = Animation_Wallpaper_HOME_PLUGIN (object);
Animation_WallpaperPrivate *priv = desktop_plugin->priv;
- if (priv){
- livewp_deinitialize_dbus(priv);
- fprintf(stderr,"finalaze %i\n", priv->long_timer);
- if (priv->long_timer){
- g_source_remove(priv->long_timer);
- priv->long_timer = 0;
- }
- if (priv->short_timer){
- g_source_remove(priv->short_timer);
- priv->short_timer = 0;
- }
-
- destroy_scene(desktop_plugin);
- }
- /* Call the base class's implementation: */
+ /* Call the base class's implementation: */
G_OBJECT_CLASS (animation_wallpaper_plugin_parent_class)->finalize (object);
}