--- rxvt-unicode/src/command.C 2006/01/25 21:03:04 1.285 +++ rxvt-unicode/src/command.C 2006/01/31 19:11:43 1.299 @@ -229,9 +229,16 @@ ch = 0xfffd; # endif scr_overlay_set (11, y, ch, r); - scr_overlay_set (12, y, NOCHAR, r); + + if (WCWIDTH (ch) >= 2) + scr_overlay_set (12, y, NOCHAR, r); } +// { +// char buf[4+4+3+1]; +// snprintf (buf, sizeof (buf), "(%.4d|%.4d)", x, y); +// scr_overlay_set (0, 0, buf); +// } scr_overlay_set (0, len , attr); scr_overlay_set (0, len + 1, fname); @@ -1166,7 +1173,7 @@ void rxvt_term::pointer_unblank () { - XDefineCursor (display->display, vt, TermWin_cursor); + XDefineCursor (xdisp, vt, TermWin_cursor); recolour_cursor (); #ifdef POINTER_BLANK @@ -1184,8 +1191,8 @@ if (!OPTION (Opt_pointerBlank)) return; - XDefineCursor (display->display, vt, display->blank_cursor); - XFlush (display->display); + XDefineCursor (xdisp, vt, display->blank_cursor); + XFlush (xdisp); hidden_pointer = 1; } @@ -2457,7 +2464,7 @@ if (!i || prop == NULL #if TINTING - || !rs[Rs_color + Color_tint] + || !ISSET_PIXCOLOR (Color_tint) #endif ) have_pixmap = 0; @@ -2533,12 +2540,12 @@ #if TINTING if (ISSET_PIXCOLOR (Color_tint)) { - unsigned short rm, gm, bm; int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; - pix_colors_focused[Color_tint].get (this, rm, gm, bm); + rgba c; + pix_colors_focused [Color_tint].get (this, c); - ShadeXImage (this, image, shade, rm, gm, bm); + ShadeXImage (this, image, shade, c.r, c.g, c.b); } #endif @@ -2569,8 +2576,7 @@ for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) { oldp = parent[i]; - XQueryTree (xdisp, parent[i - 1], &root, - &parent[i], &list, &n); + XQueryTree (xdisp, parent[i - 1], &root, &parent[i], &list, &n); XFree (list); if (parent[i] == display->root) @@ -2588,19 +2594,18 @@ n = 0; if (pchanged) - { - for (; n < (unsigned int)i; n++) - { - XGetWindowAttributes (xdisp, parent[n], &wattr); - if (wattr.depth != rootdepth || wattr.c_class == InputOnly) - { - n = (int) (sizeof (parent) / sizeof (Window)) + 1; - break; - } - } - } + for (; n < (unsigned int)i; n++) + { + XGetWindowAttributes (xdisp, parent[n], &wattr); - if (n > (int) (sizeof (parent) / sizeof (parent[0]))) + if (wattr.depth != rootdepth || wattr.c_class == InputOnly) + { + n = (int) (sizeof (parent) / sizeof (Window)) + 1; + break; + } + } + + if (n > (sizeof (parent) / sizeof (parent[0]))) { XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]); XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]); @@ -3086,7 +3091,7 @@ case '+': scr_charset_set (3, (unsigned int)cmd_getc ()); break; -#if ENABLE_FRILLS +#if !ENABLE_MINIMAL case '6': scr_backindex (); break; @@ -3097,7 +3102,7 @@ case '8': scr_cursor (RESTORE); break; -#if ENABLE_FRILLS +#if !ENABLE_MINIMAL case '9': scr_forwardindex (); break; @@ -3280,13 +3285,13 @@ if (ch == CSI_DA) /* secondary device attributes */ { // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, - // 'U' for rxvt-unicode <= 7.2, and Mm85 (e.g. 7385 for 7.3) for later versions. + // 'U' for rxvt-unicode != 7.[34] (where it was broken). // // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify // that we do not support xterm mouse reporting (should be 95 when we do). // - tt_printf ("\033[>%c%c85;94;0c", VERSION[0], VERSION[1]); + tt_printf ("\033[>%d;94;0c", 'U'); } break; case '?': @@ -3500,7 +3505,7 @@ scr_cursor (RESTORE); break; -#if ENABLE_FRILLS +#if !ENABLE_MINIMAL case CSI_74: process_window_ops (arg, nargs); break; @@ -3517,7 +3522,7 @@ } /*}}} */ -#if ENABLE_FRILLS +#if !ENABLE_MINIMAL /* ARGSUSED */ void rxvt_term::process_window_ops (const int *args, unsigned int nargs) @@ -3569,7 +3574,6 @@ (unsigned int) (args[1] * fheight)); break; - /* * reports - some output format copied from XTerm */ @@ -3716,9 +3720,15 @@ { if (str[0] == '?' && !str[1]) { - unsigned short r, g, b; - pix_colors_focused[color].get (this, r, g, b); - tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, r, g, b, resp); + rgba c; + pix_colors_focused[color].get (this, c); + +#if XFT + if (c.a != rgba::MAX_CC) + tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp); + else +#endif + tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp); } else set_window_color (color, str); @@ -3769,7 +3779,7 @@ && actual_format == 8) str = (const char *)(value); - tt_printf ("\033]%d;%s%c", XTerm_property, str, resp); + tt_printf ("\033]%d;%s%c", op, str, resp); XFree (value); } @@ -3803,36 +3813,29 @@ if ((buf = strchr (name, ';')) != NULL) *buf++ = '\0'; - if (name[0] == '?' && !name[1]) - { - unsigned short r, g, b; - pix_colors_focused[color].get (this, r, g, b); - tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); - } - else - set_window_color (color, name); + process_color_seq (op, color, name, resp); } break; case XTerm_Color00: - process_color_seq (XTerm_Color00, Color_fg, str, resp); + process_color_seq (op, Color_fg, str, resp); break; case XTerm_Color01: - process_color_seq (XTerm_Color01, Color_bg, str, resp); + process_color_seq (op, Color_bg, str, resp); break; #ifndef NO_CURSORCOLOR case XTerm_Color_cursor: - process_color_seq (XTerm_Color_cursor, Color_cursor, str, resp); + process_color_seq (op, Color_cursor, str, resp); break; #endif case XTerm_Color_pointer_fg: - process_color_seq (XTerm_Color_pointer_fg, Color_pointer_fg, str, resp); + process_color_seq (op, Color_pointer_fg, str, resp); break; case XTerm_Color_pointer_bg: - process_color_seq (XTerm_Color_pointer_bg, Color_pointer_bg, str, resp); + process_color_seq (op, Color_pointer_bg, str, resp); break; #ifndef NO_BOLD_UNDERLINE_REVERSE case XTerm_Color_RV: - process_color_seq (XTerm_Color_RV, Color_RV, str, resp); + process_color_seq (op, Color_RV, str, resp); break; case Rxvt_Color_BD: case URxvt_Color_BD: @@ -3843,15 +3846,18 @@ process_color_seq (op, Color_UL, str, resp); break; case URxvt_Color_IT: - process_color_seq (URxvt_Color_IT, Color_IT, str, resp); + process_color_seq (op, Color_IT, str, resp); break; #endif #if TRANSPARENT && TINTING case URxvt_Color_tint: - process_color_seq (URxvt_Color_tint, Color_tint, str, resp); + process_color_seq (op, Color_tint, str, resp); + check_our_parents (); + if (am_transparent) want_full_refresh = want_refresh = 1; + break; #endif @@ -3932,10 +3938,18 @@ } break; -#if ENABLE_FRILLS + case URxvt_version: + if (query) + tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%c", + op, + rs[Rs_name], VERSION[0], VERSION[2], + resp); + break; + +#if !ENABLE_MINIMAL case URxvt_locale: if (query) - tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); + tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); else { set_locale (str); @@ -4306,7 +4320,7 @@ //case 50: // not variable spacing -#if ENABLE_FRILLS +#if !ENABLE_MINIMAL case 90: case 91: /* set bright fg color */ case 92: