time_t now;
Actor *actor;
- /* TODO remove timeout */
if (!desktop_plugin->priv->visible){
- desktop_plugin->priv->short_timer = 0;
+ if(desktop_plugin->priv->short_timer != 0){
+ g_source_remove(desktop_plugin->priv->short_timer);
+ desktop_plugin->priv->short_timer = 0;
+ }
return FALSE;
}
//fprintf(stderr, "timer daytime=%d\n", daytime);
g_object_get (object, "is-on-current-desktop", &visible, NULL);
if (visible){
desktop_plugin->priv->visible = TRUE;
- desktop_plugin->priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
- }else
+ if (desktop_plugin->priv->long_timer == 0 )
+ desktop_plugin->priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
+ }else{
desktop_plugin->priv->visible = FALSE;
+ if (desktop_plugin->priv->long_timer != 0 ){
+ g_source_remove(desktop_plugin->priv->long_timer);
+ desktop_plugin->priv->long_timer = 0;
+ }
+ }
/* fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
}
gboolean
rich_animation_press(GtkWidget *widget, GdkEvent *event,
gpointer user_data){
- fprintf(stderr,"gggggggggggggggggggg\n");
+ fprintf(stderr,"gggggggggggggggggggg2222\n");
}
static void
animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
gtk_widget_set_events(rich_animation, GDK_BUTTON_PRESS_MASK);
gtk_event_box_set_visible_window(GTK_EVENT_BOX(rich_animation), FALSE);
gtk_widget_set_size_request(rich_animation, 95, 30);
- gtk_widget_show (rich_animation);
+ gtk_widget_show (rich_animation);
g_signal_connect(rich_animation, "button-press-event", G_CALLBACK(rich_animation_press), desktop_plugin);
}
/*
hd_home_plugin_item_set_settings (HD_HOME_PLUGIN_ITEM (desktop_plugin), TRUE);
g_signal_connect (desktop_plugin, "show-settings",
G_CALLBACK (lw_settings), priv);
- g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
- G_CALLBACK (desktop_plugin_visible_notify), desktop_plugin);
-
gtk_container_add (GTK_CONTAINER (desktop_plugin), rich_animation);
init_applet_position();
priv->short_timer = 0;
/* TODO Move scene to priv */
scene.timer_type = LONG_TIMER_TYPE;
-
+ g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
+ G_CALLBACK (desktop_plugin_visible_notify), desktop_plugin);
+
+
//sleep(2);
}
}
static void
-animation_wallpaper_plugin_class_finalize (AWallpaperPluginClass *class) {}
+animation_wallpaper_plugin_class_finalize (AWallpaperPluginClass *class) {
+}