ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.221 by root, Sat Dec 31 18:27:57 2005 UTC vs.
Revision 1.226 by root, Sun Jan 1 15:03:49 2006 UTC

47/*{{{ includes: */ 47/*{{{ includes: */
48#include "../config.h" /* NECESSARY */ 48#include "../config.h" /* NECESSARY */
49#include "rxvt.h" /* NECESSARY */ 49#include "rxvt.h" /* NECESSARY */
50#include "version.h" 50#include "version.h"
51#include "command.h" 51#include "command.h"
52
53#if HAVE_SCHED_YIELD
54# include <sched.h>
55#endif
52 56
53#ifdef KEYSYM_RESOURCE 57#ifdef KEYSYM_RESOURCE
54# include "keyboard.h" 58# include "keyboard.h"
55#endif 59#endif
56 60
980 SET_LOCALE (locale); 984 SET_LOCALE (locale);
981 985
982 display->flush (); 986 display->flush ();
983 987
984 if (want_refresh && !flush_ev.active) 988 if (want_refresh && !flush_ev.active)
985 flush_ev.start (NOW + 0.01); 989 flush_ev.start (NOW + 1. / 60.); // refresh at max. 60 hz normally
986} 990}
987 991
988void 992void
989rxvt_term::flush_cb (time_watcher &w) 993rxvt_term::flush_cb (time_watcher &w)
990{ 994{
1080 1084
1081 memmove (cmdbuf_base, cmdbuf_ptr, n); 1085 memmove (cmdbuf_base, cmdbuf_ptr, n);
1082 cmdbuf_ptr = cmdbuf_base; 1086 cmdbuf_ptr = cmdbuf_base;
1083 cmdbuf_endp = cmdbuf_ptr + n; 1087 cmdbuf_endp = cmdbuf_ptr + n;
1084 1088
1085 n = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); 1089 ssize_t r = read (pty.pty, cmdbuf_endp, CBUFSIZ - n);
1086 1090
1087 if (n > 0) 1091 if (r > 0)
1088 { 1092 {
1089 cmdbuf_endp += n; 1093 cmdbuf_endp += r;
1090 return true; 1094 return true;
1091 } 1095 }
1092 else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) 1096 else if (r < 0 && (errno == EAGAIN || errno == EINTR))
1097 {
1098#if HAVE_SCHED_YIELD
1099 sched_yield ();
1100#endif
1101 }
1102 else
1093 { 1103 {
1094 pty_ev.stop (); 1104 pty_ev.stop ();
1095 1105
1096 if (!OPTION (Opt_hold)) 1106 if (!OPTION (Opt_hold))
1097 destroy (); 1107 destroy ();
2684 2694
2685 if (!OPTION (Opt_jumpScroll) 2695 if (!OPTION (Opt_jumpScroll)
2686 || (refresh_count >= refresh_limit * (nrow - 1))) 2696 || (refresh_count >= refresh_limit * (nrow - 1)))
2687 { 2697 {
2688 refreshnow = true; 2698 refreshnow = true;
2699 refresh_count = 0;
2689 ch = NOCHAR; 2700 ch = NOCHAR;
2690 break; 2701 break;
2691 } 2702 }
2692 2703
2693 // scr_add_lines only works for nlines <= nrow - 1. 2704 // scr_add_lines only works for nlines <= nrow - 1.
2730 refresh_limit++; 2741 refresh_limit++;
2731 else 2742 else
2732 { 2743 {
2733 flag = true; 2744 flag = true;
2734 scr_refresh (refresh_type); 2745 scr_refresh (refresh_type);
2746 flush_ev.stop ();
2735 } 2747 }
2736 } 2748 }
2737 2749
2738 } 2750 }
2739 else 2751 else
4052 case 1021: 4064 case 1021:
4053 if (mode) 4065 if (mode)
4054 SET_OPTION (Opt_intensityStyles); 4066 SET_OPTION (Opt_intensityStyles);
4055 else 4067 else
4056 CLR_OPTION (Opt_intensityStyles); 4068 CLR_OPTION (Opt_intensityStyles);
4069
4070 scr_touch (true);
4071 break;
4057#endif 4072#endif
4058 case 1048: /* alternative cursor save */ 4073 case 1048: /* alternative cursor save */
4059 case 1049: 4074 case 1049:
4060 if (OPTION (Opt_secondaryScreen)) 4075 if (OPTION (Opt_secondaryScreen))
4061 if (mode == 0) 4076 if (mode == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines