GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
 * shoes/native/gtk.c: don't let ruby block the gui for more than half a 
 second.
 * shoes/image.c: the cache invalidation when the mtime changes is simply 
 not working yet.
why (author)
Sat Oct 04 14:43:12 -0700 2008
commit  085e6d2f32c31cf7894aca274122d3c0afc04189
tree    058868a45622d781a10288ee3543bea4e366d48e
parent  429fd7ada39dc8386322ad0903205772e9c28e24
...
694
695
696
697
698
699
700
701
702
703
 
 
 
 
 
 
 
704
705
706
...
694
695
696
 
 
 
 
 
 
 
697
698
699
700
701
702
703
704
705
706
0
@@ -694,13 +694,13 @@ shoes_cache_lookup(char *imgpath, shoes_cached_image **image)
0
 {
0
   shoes_cache_entry *cached = NULL;
0
   int ret = st_lookup(shoes_world->image_cache, (st_data_t)imgpath, (st_data_t *)&cached);
0
- if (ret && shoes_file_mtime(imgpath) == cached->image->mtime) {
0
- st_delete(shoes_world->image_cache, (st_data_t *)&imgpath, 0);
0
- // TODO: memory leak if an image's mtime changes (it's overwritten)
0
- // need to free this struct, but only after the surface is out of play
0
- // shoes_world_free_image_cache(imgpath, cached, NULL);
0
- ret = 0;
0
- }
0
+ // if (ret && shoes_file_mtime(imgpath) == cached->image->mtime) {
0
+ // st_delete(shoes_world->image_cache, (st_data_t *)&imgpath, 0);
0
+ // // TODO: memory leak if an image's mtime changes (it's overwritten)
0
+ // // need to free this struct, but only after the surface is out of play
0
+ // // shoes_world_free_image_cache(imgpath, cached, NULL);
0
+ // ret = 0;
0
+ // }
0
   if (ret) *image = cached->image;
0
   return ret;
0
 }
...
414
415
416
417
 
 
 
 
418
419
420
...
414
415
416
 
417
418
419
420
421
422
423
0
@@ -414,7 +414,10 @@ shoes_app_g_poll (GPollFD *fds, guint nfds, gint timeout)
0
   // If we poll indefinitely, then the window updates will
0
   // pile up for as long as Ruby is churning away.
0
   //
0
- if (timeout == -1)
0
+ // Give Ruby half-seconds in which to work, in order to
0
+ // keep it from completely blocking the GUI.
0
+ //
0
+ if (timeout == -1 || timeout > 500)
0
     timeout = 500;
0
   
0
   tv.tv_sec = timeout / 1000;

Comments

    No one has commented yet.