Bug#333285: xrestop: would be nice to be able to quit with 'q'

2006-01-15 Thread Moray Allan
The attached patch seems to work for this.

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

--- ../xrestop-0.3/xrestop.c2004-01-02 22:25:09.0 +
+++ xrestop-0.3/xrestop.c   2006-01-15 20:24:52.0 +
@@ -34,6 +34,7 @@
 
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -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);
+   }
+ }
}
 }
 


Bug#333285: xrestop: would be nice to be able to quit with 'q'

2005-10-11 Thread David Andel
Package: xrestop
Version: 0.3-2
Severity: wishlist

Seems that one has to kill xrestop by Ctrl-c.
It would be nice if one could quit using 'q' as usual.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-1-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages xrestop depends on:
ii  libc6 2.3.5-6GNU C Library: Shared libraries an
ii  libncurses5   5.4-9  Shared libraries for terminal hand
ii  libx11-6  6.8.2.dfsg.1-7 X Window System protocol client li
ii  libxext6  6.8.2.dfsg.1-7 X Window System miscellaneous exte
ii  xlibs 6.8.2.dfsg.1-7 X Window System client libraries m

xrestop recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]