diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-02-06 07:31:41 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-02-06 07:31:41 -0700 |
commit | 2eb52cbfe33171eda83b69d9df36cee0ff834f33 (patch) | |
tree | 7a6409b650961475ede1484f47274508cce2082f /pico/osdep/mswin.c | |
parent | dba6c62a11eed30f7a4e3e625eec8ca88252ab6c (diff) | |
download | alpine-2eb52cbfe33171eda83b69d9df36cee0ff834f33.tar.xz |
* Fix a bug in PC-Alpine that made Alpine go into an infinte loop and
consume CPU when it was iconized. Reported by Holger Schieferdecker in
comp.mail.pine.
Diffstat (limited to 'pico/osdep/mswin.c')
-rw-r--r-- | pico/osdep/mswin.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pico/osdep/mswin.c b/pico/osdep/mswin.c index 76d358ba..824ccd4c 100644 --- a/pico/osdep/mswin.c +++ b/pico/osdep/mswin.c @@ -1992,8 +1992,14 @@ PaintTTY (HWND hWnd) if (pTTYInfo == NULL) return (FALSE); - if (IsIconic (hWnd)) - return (TRUE); + // There used to be an instruction to return when we were iconized: + // if (IsIconic (hWnd)) + // return (TRUE); + // We remove this, because when Windows wants to update the screen + // and Alpine returns because the screen is iconized,, neither Windows + // nor Alpine will stop their vicious infinite cycle: Windows trying to + // force the update and Alpine avoiding it. We better yield because + // otherwise we will end up with a high consumption of CPU. hDC = BeginPaint (hWnd, &ps); rect = ps.rcPaint; @@ -6736,6 +6742,7 @@ mswin_caninput (void) int mswin_charavail (void) { + DWORD start; MSG msg; BOOL ca, pa, ma; @@ -6788,6 +6795,7 @@ mswin_charavail (void) UCS mswin_getc (void) { + DWORD start; BOOL ca, pa, ma; MSG msg; |