--- rxvt-unicode/src/command.C 2010/12/18 18:17:38 1.466 +++ rxvt-unicode/src/command.C 2011/03/07 11:48:55 1.480 @@ -27,7 +27,7 @@ * Copyright (c) 2001 Marius Gedminas * - Ctrl/Mod4+Tab works like Meta+Tab (options) * Copyright (c) 2003 Rob McMullen - * Copyright (c) 2003-2007 Marc Lehmann + * Copyright (c) 2003-2011 Marc Lehmann * Copyright (c) 2007 Emanuele Giaquinta * * This program is free software; you can redistribute it and/or modify @@ -977,10 +977,9 @@ flush_ev.stop (); #ifdef HAVE_BG_PIXMAP - if (bgPixmap.flags & bgPixmap_t::hasChanged) + if (bg_flags & BG_NEEDS_REFRESH) { - bgPixmap.flags &= ~bgPixmap_t::hasChanged; -// scr_clear (true); This needs to be researched further! + bg_flags &= ~BG_NEEDS_REFRESH; scr_touch (false); } #endif @@ -1161,10 +1160,7 @@ ssize_t n = cmdbuf_endp - cmdbuf_ptr; if (CBUFSIZ == n) - { - rxvt_warn ("PLEASE REPORT: pty_fill on full buffer, draining input, continuing.\n"); - n = 0; - } + n = 0; // normally this indicates a "too long" command sequence - just drop the data we have memmove (cmdbuf_base, cmdbuf_ptr, n); cmdbuf_ptr = cmdbuf_base; @@ -1455,7 +1451,7 @@ #ifdef HAVE_BG_PIXMAP bool moved = false; - if (bgPixmap.window_position_sensitive ()) + if (bg_window_position_sensitive ()) { int x, y; if (ev.xconfigure.send_event) @@ -1466,8 +1462,8 @@ else get_window_origin (x, y); - if (bgPixmap.set_position (x, y) - || (bgPixmap.flags & bgPixmap_t::isInvalid)) + if (bg_set_position (x, y) + || !(bg_flags & BG_IS_VALID)) moved = true; } #endif @@ -1485,7 +1481,7 @@ if (mapped) update_background (); else - bgPixmap.invalidate (); + bg_invalidate (); } #endif } @@ -1495,22 +1491,13 @@ break; case PropertyNotify: - if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END))) - if (ev.xproperty.atom == xa[XA_VT_SELECTION] - && ev.xproperty.state == PropertyNewValue) - selection_property (ev.xproperty.window, ev.xproperty.atom); - + HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END)); break; case SelectionClear: selection_clear (ev.xselectionclear.selection == xa[XA_CLIPBOARD]); break; - case SelectionNotify: - if (selection_wait == Sel_normal) - selection_paste (ev.xselection.requestor, ev.xselection.property, true); - break; - case SelectionRequest: selection_send (ev.xselectionrequest); break; @@ -1529,7 +1516,7 @@ * We should render background PRIOR to drawing any text, but AFTER all * of ConfigureNotifys for the best results. */ - if (bgPixmap.flags & bgPixmap_t::isInvalid) + if (!(bg_flags & BG_IS_VALID)) update_background_ev.start (0.025); #endif mapped = 1; @@ -1554,7 +1541,7 @@ do { scr_expose (ev.xexpose.x, ev.xexpose.y, - ev.xexpose.width, ev.xexpose.height, False); + ev.xexpose.width, ev.xexpose.height, false); } while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)); @@ -1563,7 +1550,7 @@ while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) { scr_expose (ev.xexpose.x, ev.xexpose.y, - ev.xexpose.width, ev.xexpose.height, False); + ev.xexpose.width, ev.xexpose.height, false); } want_refresh = 1; @@ -1854,7 +1841,7 @@ if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID] || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) { - bgPixmap.set_root_pixmap (); + bg_set_root_pixmap (); update_background (); } @@ -2703,7 +2690,9 @@ /* kidnapped escape sequence: Should be 8.3.48 */ case C1_ESA: /* ESC G */ - process_graphics (); + // used by original rxvt for rob nations own graphics mode + if (cmd_getc () == 'Q') + tt_printf ("\033G0\012"); /* query graphics - no graphics */ break; /* 8.3.63: CHARACTER TABULATION SET */ @@ -3456,9 +3445,7 @@ bool changed = false; if (ISSET_PIXCOLOR (Color_tint)) - changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]); - else - changed = bgPixmap.unset_tint (); + changed = bg_set_tint (pix_colors_focused [Color_tint]); if (changed) update_background (); @@ -3474,8 +3461,8 @@ char str[256]; sprintf (str, "[%dx%d+%d+%d]", - min (bgPixmap.h_scale, 32767), min (bgPixmap.v_scale, 32767), - min (bgPixmap.h_align, 32767), min (bgPixmap.v_align, 32767)); + min (h_scale, 32767), min (v_scale, 32767), + min (h_align, 32767), min (v_align, 32767)); process_xterm_seq (XTerm_title, str, CHAR_ST); } else @@ -3484,30 +3471,30 @@ if (*str != ';') { - if (bgPixmap.set_file (str)) /* change pixmap */ + if (bg_set_file (str)) /* change pixmap */ { changed++; str = strchr (str, ';'); if (str == NULL) - bgPixmap.set_defaultGeometry (); + bg_set_default_geometry (); else - bgPixmap.set_geometry (str+1); + bg_set_geometry (str+1); } } else { str++; - if (bgPixmap.set_geometry (str, true)) + if (bg_set_geometry (str, true)) changed++; } if (changed) { - if (bgPixmap.window_position_sensitive ()) + if (bg_window_position_sensitive ()) { int x, y; get_window_origin (x, y); - bgPixmap.set_position (x, y); + bg_set_position (x, y); } update_background (); } @@ -3986,25 +3973,6 @@ } /*}}} */ -/*{{{ (do not) process Rob Nation's own graphics mode sequences */ -void -rxvt_term::process_graphics () -{ - unicode_t ch, cmd = cmd_getc (); - - if (cmd == 'Q') - { - /* query graphics */ - tt_printf ("\033G0\012"); /* no graphics */ - return; - } - /* swallow other graphics sequences until terminating ':' */ - do - ch = cmd_getc (); - while (ch != ':'); -} -/*}}} */ - /* ------------------------------------------------------------------------- */ /* @@ -4042,14 +4010,16 @@ { ssize_t written = write (pty->pty, data, min (len, MAX_PTY_WRITE)); - if ((unsigned int)written == len) + max_it (written, 0); + + if (written == len) return; data += written; len -= written; } - v_buffer = (char *)realloc (v_buffer, v_buflen + len); + v_buffer = (char *)rxvt_realloc (v_buffer, v_buflen + len); memcpy (v_buffer + v_buflen, data, len); v_buflen += len;