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.295 by root, Tue Jan 31 00:25:16 2006 UTC vs.
Revision 1.301 by root, Tue Jan 31 21:23:13 2006 UTC

48#include "../config.h" 48#include "../config.h"
49#include "rxvt.h" 49#include "rxvt.h"
50#include "rxvtperl.h" 50#include "rxvtperl.h"
51#include "version.h" 51#include "version.h"
52#include "command.h" 52#include "command.h"
53
54#if HAVE_SCHED_YIELD
55#undef HAVE_SCHED_YIELD // disabled for the time being
56//# include <sched.h>
57#endif
58 53
59#ifdef KEYSYM_RESOURCE 54#ifdef KEYSYM_RESOURCE
60# include "keyboard.h" 55# include "keyboard.h"
61#endif 56#endif
62 57
1095 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); 1090 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY);
1096 } 1091 }
1097} 1092}
1098#endif 1093#endif
1099 1094
1100#if HAVE_SCHED_YIELD
1101static struct event_handler
1102{
1103 check_watcher cw_yield;
1104
1105 void yield (check_watcher &w)
1106 {
1107 sched_yield ();
1108 w.stop ();
1109 }
1110
1111 event_handler ()
1112 : cw_yield (this, &event_handler::yield)
1113 {
1114 }
1115} event_handler;
1116#endif
1117
1118bool 1095bool
1119rxvt_term::pty_fill () 1096rxvt_term::pty_fill ()
1120{ 1097{
1121 ssize_t n = cmdbuf_endp - cmdbuf_ptr; 1098 ssize_t n = cmdbuf_endp - cmdbuf_ptr;
1122 1099
1703rxvt_term::focus_in () 1680rxvt_term::focus_in ()
1704{ 1681{
1705 if (!focus) 1682 if (!focus)
1706 { 1683 {
1707 focus = 1; 1684 focus = 1;
1685 want_refresh = 1;
1708 1686
1709 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); 1687 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END));
1710 1688
1711#if USE_XIM 1689#if USE_XIM
1712 if (Input_Context != NULL) 1690 if (Input_Context != NULL)
1721#endif 1699#endif
1722#if OFF_FOCUS_FADING 1700#if OFF_FOCUS_FADING
1723 if (rs[Rs_fade]) 1701 if (rs[Rs_fade])
1724 { 1702 {
1725 pix_colors = pix_colors_focused; 1703 pix_colors = pix_colors_focused;
1726 want_refresh = 1;
1727 scr_recolour (); 1704 scr_recolour ();
1728 } 1705 }
1729#endif 1706#endif
1730 } 1707 }
1731} 1708}
1734rxvt_term::focus_out () 1711rxvt_term::focus_out ()
1735{ 1712{
1736 if (focus) 1713 if (focus)
1737 { 1714 {
1738 focus = 0; 1715 focus = 0;
1716 want_refresh = 1;
1739 1717
1740 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); 1718 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END));
1741 1719
1742#if ENABLE_FRILLS || ISO_14755 1720#if ENABLE_FRILLS || ISO_14755
1743 if (iso14755buf) 1721 if (iso14755buf)
1759#endif 1737#endif
1760#if OFF_FOCUS_FADING 1738#if OFF_FOCUS_FADING
1761 if (rs[Rs_fade]) 1739 if (rs[Rs_fade])
1762 { 1740 {
1763 pix_colors = pix_colors_unfocused; 1741 pix_colors = pix_colors_unfocused;
1764 want_refresh = 1;
1765 scr_recolour (); 1742 scr_recolour ();
1766 } 1743 }
1767#endif 1744#endif
1768 } 1745 }
1769} 1746}
2462 0L, 1L, False, XA_PIXMAP, &atype, &aformat, 2439 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2463 &nitems, &bytes_after, &prop) == Success); 2440 &nitems, &bytes_after, &prop) == Success);
2464 2441
2465 if (!i || prop == NULL 2442 if (!i || prop == NULL
2466#if TINTING 2443#if TINTING
2467 || !rs[Rs_color + Color_tint] 2444 || !ISSET_PIXCOLOR (Color_tint)
2468#endif 2445#endif
2469 ) 2446 )
2470 have_pixmap = 0; 2447 have_pixmap = 0;
2471 else 2448 else
2472 { 2449 {
2540#if TINTING 2517#if TINTING
2541 if (ISSET_PIXCOLOR (Color_tint)) 2518 if (ISSET_PIXCOLOR (Color_tint))
2542 { 2519 {
2543 int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; 2520 int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
2544 2521
2545 rxvt_rgba c; 2522 rgba c;
2546 pix_colors_focused [Color_tint].get (this, c); 2523 pix_colors_focused [Color_tint].get (c);
2547 2524
2548 ShadeXImage (this, image, shade, c.r, c.g, c.b); 2525 ShadeXImage (this, image, shade, c.r, c.g, c.b);
2549 } 2526 }
2550#endif 2527#endif
2551 2528
2574 * InheritPixmap transparency 2551 * InheritPixmap transparency
2575 */ 2552 */
2576 for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) 2553 for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++)
2577 { 2554 {
2578 oldp = parent[i]; 2555 oldp = parent[i];
2579 XQueryTree (xdisp, parent[i - 1], &root, 2556 XQueryTree (xdisp, parent[i - 1], &root, &parent[i], &list, &n);
2580 &parent[i], &list, &n);
2581 XFree (list); 2557 XFree (list);
2582 2558
2583 if (parent[i] == display->root) 2559 if (parent[i] == display->root)
2584 { 2560 {
2585 if (oldp != None) 2561 if (oldp != None)
2593 } 2569 }
2594 2570
2595 n = 0; 2571 n = 0;
2596 2572
2597 if (pchanged) 2573 if (pchanged)
2598 {
2599 for (; n < (unsigned int)i; n++) 2574 for (; n < (unsigned int)i; n++)
2600 { 2575 {
2601 XGetWindowAttributes (xdisp, parent[n], &wattr); 2576 XGetWindowAttributes (xdisp, parent[n], &wattr);
2577
2602 if (wattr.depth != rootdepth || wattr.c_class == InputOnly) 2578 if (wattr.depth != rootdepth || wattr.c_class == InputOnly)
2603 { 2579 {
2604 n = (int) (sizeof (parent) / sizeof (Window)) + 1; 2580 n = (int) (sizeof (parent) / sizeof (Window)) + 1;
2605 break; 2581 break;
2606 } 2582 }
2607 } 2583 }
2608 }
2609 2584
2610 if (n > (int) (sizeof (parent) / sizeof (parent[0]))) 2585 if (n > (sizeof (parent) / sizeof (parent[0])))
2611 { 2586 {
2612 XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]); 2587 XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]);
2613 XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]); 2588 XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]);
2614 am_transparent = 0; 2589 am_transparent = 0;
2615 /* XXX: also turn off Opt_transparent? */ 2590 /* XXX: also turn off Opt_transparent? */
3574 if (args[0] >= 24) /* set height (chars) */ 3549 if (args[0] >= 24) /* set height (chars) */
3575 set_widthheight ((unsigned int)width, 3550 set_widthheight ((unsigned int)width,
3576 (unsigned int) (args[1] * fheight)); 3551 (unsigned int) (args[1] * fheight));
3577 break; 3552 break;
3578 3553
3579
3580 /* 3554 /*
3581 * reports - some output format copied from XTerm 3555 * reports - some output format copied from XTerm
3582 */ 3556 */
3583 case 11: /* report window state */ 3557 case 11: /* report window state */
3584 XGetWindowAttributes (xdisp, parent[0], &wattr); 3558 XGetWindowAttributes (xdisp, parent[0], &wattr);
3721void 3695void
3722rxvt_term::process_color_seq (int report, int color, const char *str, char resp) 3696rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
3723{ 3697{
3724 if (str[0] == '?' && !str[1]) 3698 if (str[0] == '?' && !str[1])
3725 { 3699 {
3726 rxvt_rgba c; 3700 rgba c;
3727 pix_colors_focused[color].get (this, c); 3701 pix_colors_focused[color].get (c);
3728 3702
3729#if XFT 3703#if XFT
3730 if (c.a != rxvt_rgba::MAX_CC) 3704 if (c.a != rgba::MAX_CC)
3731 tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp); 3705 tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp);
3732 else 3706 else
3733#endif 3707#endif
3734 tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp); 3708 tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp);
3735 } 3709 }
3853 break; 3827 break;
3854#endif 3828#endif
3855#if TRANSPARENT && TINTING 3829#if TRANSPARENT && TINTING
3856 case URxvt_Color_tint: 3830 case URxvt_Color_tint:
3857 process_color_seq (op, Color_tint, str, resp); 3831 process_color_seq (op, Color_tint, str, resp);
3832
3858 check_our_parents (); 3833 check_our_parents ();
3834
3859 if (am_transparent) 3835 if (am_transparent)
3860 want_full_refresh = want_refresh = 1; 3836 want_full_refresh = want_refresh = 1;
3837
3861 break; 3838 break;
3862#endif 3839#endif
3863 3840
3864 case Rxvt_Pixmap: 3841 case Rxvt_Pixmap:
3865 { 3842 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines