Tore Bjorkeli wrote about Problems when minimized (Unmap'ed):
:I believe I have found a bug! I compiled 2.6.2 for HP-UX, and after a while
:I noticed high load on my system. I found out that rxvt procs were running,
:and they were basically just select()'ing. After a while I realized that
:this only happened with minimized/iconified terminals.

Thanks for the bug report.

:I looked around at the source for a while, and found out that normally,
:with the window active, select() (in command.c) would be called with
:NULL as the last argument (blocking). When minimized (XEvent UnmapNotify),
:I guessed that select() was called with a timeout (5000 usecs). I tried
:a quick hack, and changed the UnmapNotify handler in command.c to set
:want_refresh = 0, and MapNotify to restore want_resfresh = 1. This seems
:to have the desired effect (rxvt stays sleeping when minimized, just like
:when it's open/active). I believe, though, that the real problem lies
:elsewhere. Prehaps something should be read from a filedescriptor, or
:something (want_refresh??) should be cleared somewhere else?

It's probably a bit better to do the timeout avoidance just before
the select() call.  want_refresh should normally be cleared in scr_refresh()
however scr_refresh() has a shortcut to return early when unmapped.


Index: src/command.c
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/command.c,v
retrieving revision 1.85.2.31
retrieving revision 1.85.2.32
diff -u -r1.85.2.31 -r1.85.2.32
--- src/command.c       2000/07/26 05:10:20     1.85.2.31
+++ src/command.c       2000/08/07 05:13:25     1.85.2.32
@@ -1653,10 +1653,13 @@
        value.tv_usec = TIMEOUT_USEC;
        value.tv_sec = 0;
 
+       if (!TermWin.mapped)
+           quick_timeout = 0;
+       else
 #ifdef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
-       quick_timeout = want_refresh;
+           quick_timeout = want_refresh;
 #else
-       quick_timeout = want_refresh || scrollbar_isUpDn();
+           quick_timeout = want_refresh || scrollbar_isUpDn();
 #endif
        retval = select(num_fds, &readfds, NULL, NULL,
                        (quick_timeout ? &value : NULL));

-- 
Geoff Wing : <[EMAIL PROTECTED]>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <[EMAIL PROTECTED]>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <[EMAIL PROTECTED]>       Phone   : (Australia) 0413 431 874

Reply via email to