The attached patch seems to work for this.

-- 
Moray
http://www.morayallan.com/

--- ../xrestop-0.3/xrestop.c    2004-01-02 22:25:09.000000000 +0000
+++ xrestop-0.3/xrestop.c       2006-01-15 20:24:52.000000000 +0000
@@ -34,6 +34,7 @@
 
  */
 
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -712,12 +713,32 @@
   if (!app->want_batch_mode) 
     initscr();
 
+  cbreak();
+  noecho();
+
   for (;;)
    {
+     int delay;
+
      xrestop_populate_client_data(app);
      xrestop_sort(app);
      xrestop_display(app);
-     sleep(app->delay);
+
+     for (delay = app->delay * 10; delay > 0; delay -= 255) {
+       int c;
+
+       if (delay > 255)
+        halfdelay(255);
+       else
+        halfdelay(delay);
+       
+       c = wgetch(stdscr);
+       
+       if (c == 'q') {
+        endwin();
+        exit(0);
+       }
+     }
    }
 }
 

Reply via email to