demo: Don't add more icons all the time
authorBenjamin Otte <otte@redhat.com>
Sun, 22 Apr 2018 00:45:11 +0000 (02:45 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 22 Apr 2018 00:57:47 +0000 (02:57 +0200)
If adding new icons takes longer than a second, the frame clock should
run before we add even more icons...

demos/gtk-demo/fishbowl.c

index 689874da5e61d147b9300e1555ec992e234deb5d..7aeaf3206eb6ed5d9adcc9e6e6a594ceac636e65 100644 (file)
@@ -190,9 +190,11 @@ do_fishbowl (GtkWidget *do_widget)
                         G_CALLBACK (gtk_widget_destroyed), &window);
 
       gtk_widget_realize (window);
-      g_timeout_add_seconds (1,
-                             move_fish,
-                             bowl);
+      g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE,
+                                  1,
+                                  move_fish,
+                                  bowl,
+                                  NULL);
     }
 
   if (!gtk_widget_get_visible (window))