next step for theme orrery
authorVlad <vlad@gas.by>
Tue, 24 Aug 2010 14:00:18 +0000 (17:00 +0300)
committerVlad <vlad@gas.by>
Tue, 24 Aug 2010 14:00:18 +0000 (17:00 +0300)
applet/data/external_themes/orrery.xml
applet/src/livewp-scene.c

index 51dc72f..21d0e06 100644 (file)
@@ -1,6 +1,6 @@
 <theme>
 <name>Orrery</name>
- <exec_path>/usr/share/orrery/orreryLaunch</exec_path>
+ <exec_path>/usr/bin/orrery -d /usr/share/orrery/</exec_path>
  <window_name>orrery</window_name>
  <category>Unknown</category>
  <icon_on>/usr/share/livewp/external_icons/xscreensaver.png</icon_on>
index db587a3..d44b08a 100644 (file)
@@ -36,8 +36,8 @@ Window Window_With_Name( Display *dpy, Window top, char *name)
     class_hint = XAllocClassHint();
     XGetClassHint(dpy, top, class_hint);
     if (class_hint->res_name && name && !strcmp(class_hint->res_name, name)){
-        XFree(class_hint->res_class);
-        XFree(class_hint->res_name);
+      XFree(class_hint->res_class);
+      XFree(class_hint->res_name);
            return(top);
     }
     XFree(class_hint->res_class);
@@ -45,6 +45,7 @@ Window Window_With_Name( Display *dpy, Window top, char *name)
 
        if (XFetchName(dpy, top, &window_name) && !strcmp(window_name, name))
          return(top);
+
        if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren))
          return(0);
 
@@ -228,11 +229,10 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
     if (!desktop_plugin->priv->visible)
         return;
     
-    fprintf(stderr,"init_scene_external 111\n");
     exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
     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"));
-    fprintf(stderr,"init_scene_external 222\n");
+    window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
     if (!exec_path) 
         return;
     if (window_id){
@@ -252,13 +252,15 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){
     desktop_plugin->priv->running = TRUE;
     desktop_plugin->priv->podpid = fork();
     if (desktop_plugin->priv->podpid == 0){
+        /* hack for theme orrery */
+        if (!strcmp(window_name,"orrery"))
+            setlocale(LC_NUMERIC, "POSIX");
        execvp(child_argv[0], child_argv);
        fprintf(stderr,"Problem with new podprocess");
     }
     g_free(run_string);
-    window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
     if (window_name){
-        sleep(3);
+        sleep(2);
         id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), 
             RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
             window_name);