~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to curs_lib.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-06-07 17:30:03 UTC
  • mto: (16.2.1 experimental) (2.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090607173003-rg37ui3h2bbv7wl0
Tags: upstream-1.5.19
ImportĀ upstreamĀ versionĀ 1.5.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
   customize this is of course the Mutt way.  */
73
73
void mutt_need_hard_redraw (void)
74
74
{
75
 
  if (!getenv ("DISPLAY"))
76
 
  {
77
 
    keypad (stdscr, TRUE);
78
 
    clearok (stdscr, TRUE);
79
 
    set_option (OPTNEEDREDRAW);
80
 
  }
 
75
  keypad (stdscr, TRUE);
 
76
  clearok (stdscr, TRUE);
 
77
  set_option (OPTNEEDREDRAW);
81
78
}
82
79
 
83
80
event_t mutt_getch (void)
84
81
{
85
82
  int ch;
86
83
  event_t err = {-1, OP_NULL }, ret;
 
84
  event_t timeout = {-2, OP_NULL};
87
85
 
88
86
  if (!option(OPTUNBUFFEREDINPUT) && UngetCount)
89
87
    return (KeyEvent[--UngetCount]);
110
108
      endwin ();
111
109
      exit (1);
112
110
    }
113
 
    return err;
 
111
    return timeout;
114
112
  }
115
113
 
116
114
  if ((ch & 0x80) && option (OPTMETAKEY))
179
177
    mutt_error (_("Error running \"%s\"!"), cmd);
180
178
    mutt_sleep (2);
181
179
  }
 
180
#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
 
181
  /* the terminal may have been resized while the editor owned it */
 
182
  mutt_resize_screen ();
 
183
#endif
182
184
  keypad (stdscr, TRUE);
183
185
  clearok (stdscr, TRUE);
184
186
}
227
229
    ch = mutt_getch ();
228
230
    if (CI_is_return (ch.ch))
229
231
      break;
230
 
    if (ch.ch == -1)
 
232
    if (ch.ch < 0)
231
233
    {
232
234
      def = -1;
233
235
      break;
351
353
 
352
354
  if (!progress)
353
355
    return;
 
356
  if (option(OPTNOCURSES))
 
357
    return;
 
358
 
354
359
  memset (progress, 0, sizeof (progress_t));
355
360
  progress->inc = inc;
356
361
  progress->flags = flags;
376
381
    dprint (1, (debugfile, "gettimeofday failed: %d\n", errno));
377
382
  /* if timestamp is 0 no time-based suppression is done */
378
383
  if (TimeInc)
379
 
    progress->timestamp = tv.tv_sec * 1000 + tv.tv_usec / 1000;
 
384
    progress->timestamp = ((unsigned int) tv.tv_sec * 1000)
 
385
        + (unsigned int) (tv.tv_usec / 1000);
380
386
  mutt_progress_update (progress, 0, 0);
381
387
}
382
388
 
387
393
  struct timeval tv = { 0, 0 };
388
394
  unsigned int now = 0;
389
395
 
 
396
  if (option(OPTNOCURSES))
 
397
    return;
 
398
 
390
399
  if (!progress->inc)
391
400
    goto out;
392
401
 
399
408
 
400
409
  /* skip refresh if not enough time has passed */
401
410
  if (update && progress->timestamp && !gettimeofday (&tv, NULL)) {
402
 
    now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
 
411
    now = ((unsigned int) tv.tv_sec * 1000)
 
412
          + (unsigned int) (tv.tv_usec / 1000);
403
413
    if (now && now - progress->timestamp < TimeInc)
404
414
      update = 0;
405
415
  }
553
563
  mutt_refresh ();
554
564
 
555
565
  ch = mutt_getch();
556
 
  if (ch.ch == -1)
 
566
  if (ch.ch < 0)
557
567
  {
558
568
    CLEARLINE (LINES-1);
559
569
    return (-1);
635
645
  {
636
646
    mutt_refresh ();
637
647
    ch  = mutt_getch ();
638
 
    if (ch.ch == -1 || CI_is_return (ch.ch))
 
648
    if (ch.ch < 0 || CI_is_return (ch.ch))
639
649
    {
640
650
      choice = -1;
641
651
      break;