added select file into dialog
[livewp] / applet / src / livewp-scene.c
index 79958c3..ffd4abe 100644 (file)
@@ -7,8 +7,8 @@
  *       for the code
  * 
  * This software is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of
  * the License, or (at your option) any later version.
  * 
  * This software is distributed in the hope that it will be useful, but
@@ -38,7 +38,7 @@ Window Window_With_Name( Display *dpy, Window top, char *name)
     if (class_hint->res_name && name && !strcmp(class_hint->res_name, name)){
       XFree(class_hint->res_class);
       XFree(class_hint->res_name);
-           return(top);
+      return(top);
     }
     XFree(class_hint->res_class);
     XFree(class_hint->res_name);
@@ -227,8 +227,13 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
         *window_id = NULL,
         *window_name = NULL,
         *view = NULL,
+        *gtk_socket_id = NULL,
         *strwin = NULL,
-        *strview =NULL;
+        *strsocket = NULL,
+        *addedstring = NULL,
+        *theme_string_parametr1 = NULL,
+        *straddedstring = NULL,
+        *strview = NULL;
     gint i;
     Window  id_xwindow;
     if (!desktop_plugin->priv->visible)
@@ -238,19 +243,35 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
     window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
     view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
     window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
+    gtk_socket_id =  g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "gtk_socket_id"));
+    addedstring =  g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "added_string"));
     if (!exec_path) 
         return;
     if (window_id){
         strwin = g_strdup_printf(" %s %i", window_id, (gint)GDK_WINDOW_XID(desktop_plugin->priv->window->window));
     }else
         strwin = "";
+    if (gtk_socket_id){
+        strsocket = g_strdup_printf(" %s %i", gtk_socket_id, (int)gtk_socket_get_id (GTK_SOCKET (desktop_plugin->priv->video_socket)));
+    }else
+        strsocket = "";
 
     if (view){
         strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
     }else
         strview = "";
 
-    run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
+    if (addedstring){
+        straddedstring = g_strdup_printf(" %s", addedstring);
+    }else
+        straddedstring = "";
+
+    if (desktop_plugin->priv->theme_string_parametr1){
+        theme_string_parametr1 = g_strdup_printf(" %s", desktop_plugin->priv->theme_string_parametr1);
+    }else
+        theme_string_parametr1 = "";
+
+    run_string = g_strdup_printf("%s%s%s%s%s%s", exec_path, strwin, strview, strsocket, straddedstring, theme_string_parametr1);
     fprintf(stderr, "runs string = %s\n", run_string);
     parsestring(run_string, child_argv);
 
@@ -261,6 +282,8 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
        fprintf(stderr,"Problem with new podprocess");
     }
     g_free(run_string);
+
+    fprintf(stderr, "window name = %s\n", window_name);
     if (window_name){
         /* Do 10 trying to search of window */
         for (i=0; i<10; i++){