added function kill to conky
authorVlad <vlad@gas.by>
Tue, 31 Aug 2010 14:10:41 +0000 (17:10 +0300)
committerVlad <vlad@gas.by>
Tue, 31 Aug 2010 14:10:41 +0000 (17:10 +0300)
applet/src/livewp-conky.c
applet/src/livewp-conky.h
applet/src/livewp-main.c

index dfa4020..012a6ee 100644 (file)
@@ -74,4 +74,11 @@ init_scene_Conky(AWallpaperPlugin *desktop_plugin){
     create_config(False);
     init_scene_External(desktop_plugin);
 }
-
+void
+conky_visible(AWallpaperPlugin *desktop_plugin){
+    if (desktop_plugin->priv->visible)
+       create_config(FALSE);
+    else
+       create_config(TRUE);
+    kill (desktop_plugin->priv->podpid, SIGHUP);
+}
index 3161521..99a2d7e 100644 (file)
@@ -25,3 +25,4 @@
 #include "livewp-common.h"
 void init_scene_Conky(AWallpaperPlugin *desktop_plugin);
 void init_scene_External(AWallpaperPlugin *desktop_plugin);
+void conky_visible(AWallpaperPlugin *desktop_plugin);
index 28b6fd1..7255562 100644 (file)
@@ -34,6 +34,7 @@ void view_state_changed (Animation_WallpaperPrivate *priv);
 static gboolean short_timeout (AWallpaperPlugin *desktop_plugin);
 void run_long_timeout(AWallpaperPlugin *desktop_plugin);
 gboolean long_timeout (AWallpaperPlugin *desktop_plugin);
+void conky_visible(AWallpaperPlugin *desktop_plugin);
 
 void 
 set_live_bg (Display *display, Window xwindow, int mode)
@@ -55,7 +56,8 @@ void
 view_state_changed (Animation_WallpaperPrivate *priv)
 {
    fprintf(stderr," VIew %i State %i\n", priv->view, priv->visible);
-   if (priv->visible){       
+   if (priv->visible){  
+       /* ToDo  make undependent function */
        if (!strcmp(priv->theme,"Video")){
            if (priv->pipeline){
                gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
@@ -68,6 +70,10 @@ view_state_changed (Animation_WallpaperPrivate *priv)
                 init_scene_External(priv->desktop_plugin);
             }
        }
+       if (!strcmp(priv->theme,"Conky")){
+           conky_visible(priv->desktop_plugin);
+       }
+
        if (priv->long_timer == 0 ){
             priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, priv->desktop_plugin);
             run_long_timeout(priv->desktop_plugin);