<<< Date Index >>>     <<< Thread Index >>>

[PATCH] Window resize while opening mailbox (was Re: bug#1907: mutt-1.4.1i: Window resize mishandling on suspend case)



* Adeodato Simó [Mon, 28 Jun 2004 03:53:18 +0200]:

> * Thomas Dickey [Fri, 25 Jun 2004 19:55:38 -0400]:

> > I'd be inclined to say the problem is in mutt (common factor).  But it
> > could be a similar bug but not the same one.  Seeing if mutt's sigwinch
> > handler is blocked or not seems to be the real issue.  Just reading the
> > code, I don't see the problem though.

>   SIGWINCH is in fact *blocked* while doing "critical ops". see
>   mutt_block_signals in signal.c. so, after reading the mailbox,
>   SigWinch is 0 even though a SIGWINCH was sent.

  Forget the whole thing about SIGWINCH being blocked. I've realized it
  doesn't change a thing. The SigWinch variable gets its (correct) value
  whether it's blocked or not.

  Strangely enough for me, the bug seems to depend on the position of
  the

    if (SigWinch)
    {
      /* etc. */
    }

  block in curs_main.c:mutt_index_menu(). Putting it just before the 

      op = km_dokey (MENU_MAIN);

  line instead of just after it seems to solve the problem here (!).

  I'd like to know if others see the behavior corrected with the
  attached patch, and if it's likely to break something (seems
  inoffensive to me) which should prevent it being applied upstream.
  An explanation of what is happening would be nice too, though I guess
  I can live without it. ;-)

  thanks,

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
 
Let us not be ashamed to speak what we shame not to think.
                -- Michel de Montaigne
--- curs_main.c.orig    2004-06-28 04:57:39.000000000 +0200
+++ curs_main.c 2004-06-28 04:57:49.000000000 +0200
@@ -576,10 +576,6 @@
        move (menu->current - menu->top + menu->offset, COLS - 1);
       mutt_refresh ();
 
-      op = km_dokey (MENU_MAIN);
-
-      dprint(4, (debugfile, "mutt_index_menu[%d]: Got op %d\n", __LINE__, op));
-
 #if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
       if (SigWinch)
       {
@@ -598,6 +594,10 @@
       }
 #endif
 
+      op = km_dokey (MENU_MAIN);
+
+      dprint(4, (debugfile, "mutt_index_menu[%d]: Got op %d\n", __LINE__, op));
+
       if (op == -1)
        continue; /* either user abort or timeout */