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.324 by sasha, Fri Jun 8 20:04:12 2007 UTC vs.
Revision 1.349 by ayin, Sun Aug 26 18:16:52 2007 UTC

95 XK_Shift_L, 0x21e7, 95 XK_Shift_L, 0x21e7,
96 XK_Shift_R, 0x21e7, 96 XK_Shift_R, 0x21e7,
97 97
98 XK_Shift_Lock, 0x21eb, 98 XK_Shift_Lock, 0x21eb,
99 XK_ISO_Lock, 0x21eb, 99 XK_ISO_Lock, 0x21eb,
100 XK_ISO_Lock, 0x21eb,
101 XK_Caps_Lock, 0x21ec, 100 XK_Caps_Lock, 0x21ec,
102 XK_Num_Lock, 0x21ed, 101 XK_Num_Lock, 0x21ed,
103 XK_ISO_Level3_Shift, 0x21ee, 102 XK_ISO_Level3_Shift, 0x21ee,
104 XK_ISO_Level3_Lock, 0x21ef, 103 XK_ISO_Level3_Lock, 0x21ef,
105 XK_ISO_Group_Lock, 0x21f0, 104 XK_ISO_Group_Lock, 0x21f0,
519# endif 518# endif
520 return; 519 return;
521 } 520 }
522 else 521 else
523 { 522 {
524# if ENABLE_OVERLAY 523# if ISO_14755
525 scr_overlay_off (); 524 scr_overlay_off ();
526# endif 525# endif
527 iso14755buf = 0; 526 iso14755buf = 0;
528 } 527 }
529 } 528 }
530 else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) 529 else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R))
531 || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) 530 || (shft && (keysym == XK_Control_L || keysym == XK_Control_R)))
532 if (!(iso14755buf & ISO_14755_STARTED)) 531 if (!(iso14755buf & ISO_14755_STARTED))
533 { 532 {
534 iso14755buf |= ISO_14755_STARTED; 533 iso14755buf |= ISO_14755_STARTED;
535# if ENABLE_OVERLAY 534# if ISO_14755
536 scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); 535 scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1);
537 scr_overlay_set (0, 0, "ISO 14755 mode"); 536 scr_overlay_set (0, 0, "ISO 14755 mode");
538# endif 537# endif
539 } 538 }
540#endif 539#endif
541 540
542#ifdef PRINTPIPE 541#ifdef PRINTPIPE
543 if (keysym == XK_Print) 542 if (keysym == XK_Print)
544 { 543 {
545 scr_printscreen (ctrl | shft); 544 scr_printscreen (ctrl | shft);
546 return; 545 return;
728 727
729 case XK_Find: 728 case XK_Find:
730 strcpy (kbuf, "\033[1~"); 729 strcpy (kbuf, "\033[1~");
731 break; 730 break;
732 731
733#ifdef XK_KP_End 732#ifdef XK_KP_Insert
734 case XK_KP_Insert: 733 case XK_KP_Insert:
735 /* allow shift to override */ 734 /* allow shift to override */
736 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 735 if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
737 { 736 {
738 strcpy (kbuf, "\033Op"); 737 strcpy (kbuf, "\033Op");
934#if ENABLE_FRILLS || ISO_14755 933#if ENABLE_FRILLS || ISO_14755
935 // ISO 14755 support 934 // ISO 14755 support
936 if (iso14755buf) 935 if (iso14755buf)
937 if (iso14755buf & ISO_14755_52) 936 if (iso14755buf & ISO_14755_52)
938 { 937 {
939# if ENABLE_OVERLAY 938# if ISO_14755
940 scr_overlay_off (); 939 scr_overlay_off ();
941# endif 940# endif
942# if ISO_14755 941# if ISO_14755
943 // iso14755 part 5.2 handling: release time 942 // iso14755 part 5.2 handling: release time
944 // first: controls 943 // first: controls
967 966
968 return; 967 return;
969 } 968 }
970 else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) 969 else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask))
971 { 970 {
972# if ENABLE_OVERLAY 971# if ISO_14755
973 scr_overlay_off (); 972 scr_overlay_off ();
974# endif 973# endif
975 if (iso14755buf & ISO_14755_51) 974 if (iso14755buf & ISO_14755_51)
976 commit_iso14755 (); 975 commit_iso14755 ();
977#if ISO_14755 976#if ISO_14755
978 else if (iso14755buf & ISO_14755_STARTED) 977 else if (option (Opt_iso14755_52) && iso14755buf & ISO_14755_STARTED)
979 { 978 {
980 iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair 979 iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair
981 980
982 scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1); 981 scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1);
983 scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE"); 982 scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE");
1035void 1034void
1036rxvt_term::flush () 1035rxvt_term::flush ()
1037{ 1036{
1038 flush_ev.stop (); 1037 flush_ev.stop ();
1039 1038
1040#ifdef TRANSPARENT 1039#ifdef ENABLE_TRANSPARENCY
1041 if (want_full_refresh) 1040 if (want_full_refresh)
1042 { 1041 {
1043 want_full_refresh = 0; 1042 want_full_refresh = 0;
1044 scr_clear (); 1043 scr_clear ();
1045 scr_touch (false); 1044 scr_touch (false);
1110void 1109void
1111rxvt_term::flush_cb (time_watcher &w) 1110rxvt_term::flush_cb (time_watcher &w)
1112{ 1111{
1113 make_current (); 1112 make_current ();
1114 1113
1115 refresh_limit = 1;
1116 refresh_count = 0; 1114 refresh_count = 0;
1117 flush (); 1115 flush ();
1118} 1116}
1119 1117
1120#ifdef CURSOR_BLINK 1118#ifdef CURSOR_BLINK
1186 1184
1187#if LINUX_YIELD_HACK 1185#if LINUX_YIELD_HACK
1188static struct event_handler 1186static struct event_handler
1189{ 1187{
1190 check_watcher yield_ev; 1188 check_watcher yield_ev;
1191 1189
1192 void yield_cb (check_watcher &w) 1190 void yield_cb (check_watcher &w)
1193 { 1191 {
1194 // this should really be sched_yield(), but the linux guys thought 1192 // this should really be sched_yield(), but the linux guys thought
1195 // that giving a process calling sched_yield () less cpu time than 1193 // that giving a process calling sched_yield () less cpu time than
1196 // ones with high nice levels is a useful thing to do. It surely is is 1194 // ones with high nice levels is a useful thing to do. It surely is is
1243 pty_ev.stop (); 1241 pty_ev.stop ();
1244 1242
1245 if (!option (Opt_hold)) 1243 if (!option (Opt_hold))
1246 destroy (); 1244 destroy ();
1247 } 1245 }
1248 1246
1249 return false; 1247 return false;
1250} 1248}
1251 1249
1252void 1250void
1253rxvt_term::pty_cb (io_watcher &w, short revents) 1251rxvt_term::pty_cb (io_watcher &w, short revents)
1434 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) 1432 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT)
1435 focus_out (); 1433 focus_out ();
1436 } 1434 }
1437#endif 1435#endif
1438 } 1436 }
1439 break;
1440
1441 case MappingNotify:
1442 XRefreshKeyboardMapping (&ev.xmapping);
1443 break; 1437 break;
1444 1438
1445 /* 1439 /*
1446 * XXX: this is not the _current_ arrangement 1440 * XXX: this is not the _current_ arrangement
1447 * Here's my conclusion: 1441 * Here's my conclusion:
1480 && ev.xfocus.mode != NotifyGrab) 1474 && ev.xfocus.mode != NotifyGrab)
1481 focus_out (); 1475 focus_out ();
1482 break; 1476 break;
1483 1477
1484 case ConfigureNotify: 1478 case ConfigureNotify:
1479/* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n",
1480 ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y,
1481 szHint.width, szHint.height);*/
1485 if (ev.xconfigure.window == parent[0]) 1482 if (ev.xconfigure.window == parent[0])
1486 { 1483 {
1487 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) 1484 while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev))
1488 ; 1485 ;
1489 1486
1490 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) 1487 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height)
1491 { 1488 {
1492 seen_resize = 1; 1489 seen_resize = 1;
1493 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1490 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1494#ifdef XPM_BACKGROUND
1495 if (!option(Opt_transparent) && bgPixmap.auto_resize)
1496 {
1497 resize_pixmap ();
1498 scr_touch (true);
1499 }
1500#endif
1501 } 1491 }
1502 1492 else
1493 {
1494#ifdef ENABLE_TRANSPARENCY
1495 if (option (Opt_transparent))
1496 update_background ();
1497#endif
1498 }
1503 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1499 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1504
1505#ifdef TRANSPARENT
1506 if (option (Opt_transparent))
1507 check_our_parents ();
1508#endif
1509 } 1500 }
1510 break; 1501 break;
1511 1502
1512 case PropertyNotify: 1503 case PropertyNotify:
1513 if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END))) 1504 if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END)))
1544 text_blink_ev.stop (); 1535 text_blink_ev.stop ();
1545#endif 1536#endif
1546 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1537 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1547 break; 1538 break;
1548 1539
1549#ifdef TRANSPARENT 1540#ifdef ENABLE_TRANSPARENCY
1550 case ReparentNotify: 1541 case ReparentNotify:
1551 rootwin_cb (ev); 1542 rootwin_cb (ev);
1552 break; 1543 break;
1553#endif /* TRANSPARENT */ 1544#endif /* ENABLE_TRANSPARENCY */
1554 1545
1555 case GraphicsExpose: 1546 case GraphicsExpose:
1556 case Expose: 1547 case Expose:
1557 if (ev.xany.window == vt) 1548 if (ev.xany.window == vt)
1558 { 1549 {
1581 if (isScrollbarWindow (ev.xany.window)) 1572 if (isScrollbarWindow (ev.xany.window))
1582 { 1573 {
1583 scrollBar.setIdle (); 1574 scrollBar.setIdle ();
1584 scrollbar_show (0); 1575 scrollbar_show (0);
1585 } 1576 }
1586
1587#ifdef TRANSPARENT
1588 if (am_transparent && ev.xany.window == parent[0])
1589 XClearWindow (dpy, ev.xany.window);
1590#endif
1591 } 1577 }
1592 break; 1578 break;
1593 1579
1594 case MotionNotify: 1580 case MotionNotify:
1595#ifdef POINTER_BLANK 1581#ifdef POINTER_BLANK
1693 &ev.xbutton.x, &ev.xbutton.y, 1679 &ev.xbutton.x, &ev.xbutton.y,
1694 &unused_mask); 1680 &unused_mask);
1695 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, 1681 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO,
1696 scrollbar_size ()); 1682 scrollbar_size ());
1697 want_refresh = 1; 1683 want_refresh = 1;
1698 refresh_limit = 0;
1699 scrollbar_show (1); 1684 scrollbar_show (1);
1700 } 1685 }
1701 break; 1686 break;
1702 } 1687 }
1703 1688
1785 1770
1786#if ENABLE_FRILLS || ISO_14755 1771#if ENABLE_FRILLS || ISO_14755
1787 if (iso14755buf) 1772 if (iso14755buf)
1788 { 1773 {
1789 iso14755buf = 0; 1774 iso14755buf = 0;
1790# if ENABLE_OVERLAY 1775# if ISO_14755
1791 scr_overlay_off (); 1776 scr_overlay_off ();
1792# endif 1777# endif
1793 } 1778 }
1794#endif 1779#endif
1795#if USE_XIM 1780#if USE_XIM
1822 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1807 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1823 } 1808 }
1824#endif 1809#endif
1825} 1810}
1826 1811
1827#if TRANSPARENT || ENABLE_PERL 1812#if ENABLE_TRANSPARENCY || ENABLE_PERL
1828void 1813void
1829rxvt_term::rootwin_cb (XEvent &ev) 1814rxvt_term::rootwin_cb (XEvent &ev)
1830{ 1815{
1831 make_current (); 1816 make_current ();
1832 1817
1833 if (SHOULD_INVOKE (HOOK_ROOT_EVENT) 1818 if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
1834 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) 1819 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
1835 return; 1820 return;
1836 1821
1837# if TRANSPARENT 1822# if ENABLE_TRANSPARENCY
1838 switch (ev.type) 1823 switch (ev.type)
1839 { 1824 {
1840 case PropertyNotify: 1825 case PropertyNotify:
1841 /* 1826 /*
1842 * if user used some Esetroot compatible prog to set the root bg, 1827 * if user used some Esetroot compatible prog to set the root bg,
1843 * use the property to determine the pixmap. We use it later on. 1828 * use the property to determine the pixmap. We use it later on.
1844 */ 1829 */
1845 if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID] 1830 if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID]
1846 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) 1831 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID])
1847 return; 1832 {
1848 1833 bgPixmap.set_root_pixmap ();
1849 /* FALLTHROUGH */ 1834 update_background ();
1850 case ReparentNotify: 1835 }
1851 if (option (Opt_transparent))
1852 check_our_parents ();
1853 break; 1836 break;
1854 } 1837 }
1855# endif 1838# endif
1856} 1839}
1857#endif 1840#endif
2234#endif 2217#endif
2235 } 2218 }
2236 } 2219 }
2237} 2220}
2238 2221
2239#ifdef TRANSPARENT
2240#if TINTING && !defined(HAVE_AFTERIMAGE)
2241/* taken from aterm-0.4.2 */
2242
2243typedef uint32_t RUINT32T;
2244
2245void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm)
2246{
2247 int sh_r, sh_g, sh_b;
2248 RUINT32T mask_r, mask_g, mask_b;
2249 RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b;
2250 unsigned int lower_lim_r, lower_lim_g, lower_lim_b;
2251 unsigned int upper_lim_r, upper_lim_g, upper_lim_b;
2252 int i;
2253
2254 Visual *visual = term->visual;
2255
2256 if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ;
2257
2258 /* for convenience */
2259 mask_r = visual->red_mask;
2260 mask_g = visual->green_mask;
2261 mask_b = visual->blue_mask;
2262
2263 /* boring lookup table pre-initialization */
2264 switch (srcImage->bits_per_pixel) {
2265 case 15:
2266 if ((mask_r != 0x7c00) ||
2267 (mask_g != 0x03e0) ||
2268 (mask_b != 0x001f))
2269 return;
2270 lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+32+32));
2271 lookup_r = lookup;
2272 lookup_g = lookup+32;
2273 lookup_b = lookup+32+32;
2274 sh_r = 10;
2275 sh_g = 5;
2276 sh_b = 0;
2277 break;
2278 case 16:
2279 if ((mask_r != 0xf800) ||
2280 (mask_g != 0x07e0) ||
2281 (mask_b != 0x001f))
2282 return;
2283 lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+64+32));
2284 lookup_r = lookup;
2285 lookup_g = lookup+32;
2286 lookup_b = lookup+32+64;
2287 sh_r = 11;
2288 sh_g = 5;
2289 sh_b = 0;
2290 break;
2291 case 24:
2292 if ((mask_r != 0xff0000) ||
2293 (mask_g != 0x00ff00) ||
2294 (mask_b != 0x0000ff))
2295 return;
2296 lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256));
2297 lookup_r = lookup;
2298 lookup_g = lookup+256;
2299 lookup_b = lookup+256+256;
2300 sh_r = 16;
2301 sh_g = 8;
2302 sh_b = 0;
2303 break;
2304 case 32:
2305 if ((mask_r != 0xff0000) ||
2306 (mask_g != 0x00ff00) ||
2307 (mask_b != 0x0000ff))
2308 return;
2309 lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256));
2310 lookup_r = lookup;
2311 lookup_g = lookup+256;
2312 lookup_b = lookup+256+256;
2313 sh_r = 16;
2314 sh_g = 8;
2315 sh_b = 0;
2316 break;
2317 default:
2318 return; /* we do not support this color depth */
2319 }
2320
2321 /* prepare limits for color transformation (each channel is handled separately) */
2322 if (shade < 0) {
2323 shade = -shade;
2324 if (shade < 0) shade = 0;
2325 if (shade > 100) shade = 100;
2326
2327 lower_lim_r = 65535-rm;
2328 lower_lim_g = 65535-gm;
2329 lower_lim_b = 65535-bm;
2330
2331 lower_lim_r = 65535-(unsigned int)(((RUINT32T)lower_lim_r)*((RUINT32T)shade)/100);
2332 lower_lim_g = 65535-(unsigned int)(((RUINT32T)lower_lim_g)*((RUINT32T)shade)/100);
2333 lower_lim_b = 65535-(unsigned int)(((RUINT32T)lower_lim_b)*((RUINT32T)shade)/100);
2334
2335 upper_lim_r = upper_lim_g = upper_lim_b = 65535;
2336 } else {
2337 if (shade < 0) shade = 0;
2338 if (shade > 100) shade = 100;
2339
2340 lower_lim_r = lower_lim_g = lower_lim_b = 0;
2341
2342 upper_lim_r = (unsigned int)((((RUINT32T)rm)*((RUINT32T)shade))/100);
2343 upper_lim_g = (unsigned int)((((RUINT32T)gm)*((RUINT32T)shade))/100);
2344 upper_lim_b = (unsigned int)((((RUINT32T)bm)*((RUINT32T)shade))/100);
2345 }
2346
2347 /* switch red and blue bytes if necessary, we need it for some weird XServers like XFree86 3.3.3.1 */
2348 if ((srcImage->bits_per_pixel == 24) && (mask_r >= 0xFF0000 ))
2349 {
2350 unsigned int tmp;
2351
2352 tmp = lower_lim_r;
2353 lower_lim_r = lower_lim_b;
2354 lower_lim_b = tmp;
2355
2356 tmp = upper_lim_r;
2357 upper_lim_r = upper_lim_b;
2358 upper_lim_b = tmp;
2359 }
2360
2361 /* fill our lookup tables */
2362 for (i = 0; i <= mask_r>>sh_r; i++)
2363 {
2364 RUINT32T tmp;
2365 tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_r-lower_lim_r));
2366 tmp += ((RUINT32T)(mask_r>>sh_r))*((RUINT32T)lower_lim_r);
2367 lookup_r[i] = (tmp/65535)<<sh_r;
2368 }
2369 for (i = 0; i <= mask_g>>sh_g; i++)
2370 {
2371 RUINT32T tmp;
2372 tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_g-lower_lim_g));
2373 tmp += ((RUINT32T)(mask_g>>sh_g))*((RUINT32T)lower_lim_g);
2374 lookup_g[i] = (tmp/65535)<<sh_g;
2375 }
2376 for (i = 0; i <= mask_b>>sh_b; i++)
2377 {
2378 RUINT32T tmp;
2379 tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_b-lower_lim_b));
2380 tmp += ((RUINT32T)(mask_b>>sh_b))*((RUINT32T)lower_lim_b);
2381 lookup_b[i] = (tmp/65535)<<sh_b;
2382 }
2383
2384 /* apply table to input image (replacing colors by newly calculated ones) */
2385 switch (srcImage->bits_per_pixel)
2386 {
2387 case 15:
2388 {
2389 unsigned short *p1, *pf, *p, *pl;
2390 p1 = (unsigned short *) srcImage->data;
2391 pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
2392 while (p1 < pf)
2393 {
2394 p = p1;
2395 pl = p1 + srcImage->width;
2396 for (; p < pl; p++)
2397 {
2398 *p = lookup_r[(*p & 0x7c00)>>10] |
2399 lookup_g[(*p & 0x03e0)>> 5] |
2400 lookup_b[(*p & 0x001f)];
2401 }
2402 p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line);
2403 }
2404 break;
2405 }
2406 case 16:
2407 {
2408 unsigned short *p1, *pf, *p, *pl;
2409 p1 = (unsigned short *) srcImage->data;
2410 pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
2411 while (p1 < pf)
2412 {
2413 p = p1;
2414 pl = p1 + srcImage->width;
2415 for (; p < pl; p++)
2416 {
2417 *p = lookup_r[(*p & 0xf800)>>11] |
2418 lookup_g[(*p & 0x07e0)>> 5] |
2419 lookup_b[(*p & 0x001f)];
2420 }
2421 p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line);
2422 }
2423 break;
2424 }
2425 case 24:
2426 {
2427 unsigned char *p1, *pf, *p, *pl;
2428 p1 = (unsigned char *) srcImage->data;
2429 pf = (unsigned char *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
2430 while (p1 < pf)
2431 {
2432 p = p1;
2433 pl = p1 + srcImage->width * 3;
2434 for (; p < pl; p += 3)
2435 {
2436 p[0] = lookup_r[(p[0] & 0xff0000)>>16];
2437 p[1] = lookup_r[(p[1] & 0x00ff00)>> 8];
2438 p[2] = lookup_r[(p[2] & 0x0000ff)];
2439 }
2440 p1 = (unsigned char *) ((char *) p1 + srcImage->bytes_per_line);
2441 }
2442 break;
2443 }
2444 case 32:
2445 {
2446 RUINT32T *p1, *pf, *p, *pl;
2447 p1 = (RUINT32T *) srcImage->data;
2448 pf = (RUINT32T *) (srcImage->data + srcImage->height * srcImage->bytes_per_line);
2449
2450 while (p1 < pf)
2451 {
2452 p = p1;
2453 pl = p1 + srcImage->width;
2454 for (; p < pl; p++)
2455 {
2456 *p = lookup_r[(*p & 0xff0000)>>16] |
2457 lookup_g[(*p & 0x00ff00)>> 8] |
2458 lookup_b[(*p & 0x0000ff)] |
2459 (*p & ~0xffffff);
2460 }
2461 p1 = (RUINT32T *) ((char *) p1 + srcImage->bytes_per_line);
2462 }
2463 break;
2464 }
2465 }
2466
2467 free (lookup);
2468}
2469#endif
2470
2471/*
2472 * Check our parents are still who we think they are.
2473 * Do transparency updates if required
2474 */
2475int
2476rxvt_term::check_our_parents ()
2477{
2478#if TRANSPARENT || ENABLE_PERL
2479 check_our_aprents_ev.stop();
2480 check_our_aprents_ev.start(NOW + 1./3.);
2481#endif
2482 return 0;
2483}
2484
2485void
2486rxvt_term::check_our_parents_cb (time_watcher &w)
2487{
2488 int i, pchanged, aformat, have_pixmap, rootdepth;
2489 unsigned long nitems, bytes_after;
2490 Atom atype;
2491 unsigned char *prop = NULL;
2492 Window root, oldp, *list;
2493 Pixmap rootpixmap = None;
2494 XWindowAttributes wattr, wrootattr;
2495 int sx, sy;
2496 Window cr;
2497
2498 pchanged = 0;
2499
2500 if (!option (Opt_transparent))
2501 return /*pchanged*/; /* Don't try any more */
2502
2503 XGetWindowAttributes (dpy, display->root, &wrootattr);
2504 rootdepth = wrootattr.depth;
2505
2506 XGetWindowAttributes (dpy, parent[0], &wattr);
2507
2508 if (rootdepth != wattr.depth)
2509 {
2510 if (am_transparent)
2511 {
2512 pchanged = 1;
2513 XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]);
2514 am_transparent = am_pixmap_trans = 0;
2515 }
2516
2517 return /*pchanged*/; /* Don't try any more */
2518 }
2519
2520 /* Get all X ops out of the queue so that our information is up-to-date. */
2521 XSync (dpy, False);
2522
2523 XTranslateCoordinates (dpy, parent[0], display->root,
2524 0, 0, &sx, &sy, &cr);
2525
2526 /* check if we are outside of the visible part of the virtual screen : */
2527 if( sx + (int)szHint.width <= 0 || sy + (int)szHint.height <= 0
2528 || sx >= wrootattr.width || sy >= wrootattr.height )
2529 return /* 0 */ ;
2530 /*
2531 * Make the frame window set by the window manager have
2532 * the root background. Some window managers put multiple nested frame
2533 * windows for each client, so we have to take care about that.
2534 */
2535 i = (xa[XA_XROOTPMAP_ID]
2536 && XGetWindowProperty (dpy, display->root, xa[XA_XROOTPMAP_ID],
2537 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2538 &nitems, &bytes_after, &prop) == Success);
2539
2540 if (!i || prop == NULL)
2541 i = (xa[XA_ESETROOT_PMAP_ID]
2542 && XGetWindowProperty (dpy, display->root, xa[XA_ESETROOT_PMAP_ID],
2543 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2544 &nitems, &bytes_after, &prop) == Success);
2545
2546 if (!i || prop == NULL
2547#if TINTING
2548 || (!ISSET_PIXCOLOR (Color_tint) && rs[Rs_shade] == NULL
2549#ifdef HAVE_AFTERIMAGE
2550 && original_asim == NULL && rs[Rs_blurradius] == NULL
2551#endif
2552 )
2553#endif
2554 )
2555 have_pixmap = 0;
2556 else
2557 {
2558 have_pixmap = 1;
2559 rootpixmap = *(Pixmap *)prop;
2560 XFree (prop);
2561 }
2562
2563 if (have_pixmap)
2564 {
2565 Bool success = False ;
2566 GC gc;
2567 XGCValues gcvalue;
2568#ifdef HAVE_AFTERIMAGE
2569 {
2570 Pixmap tmp_pmap = None ;
2571 ShadingInfo shade;
2572 ARGB32 tint ;
2573 unsigned int pmap_w = 0, pmap_h = 0;
2574
2575 if (get_drawable_size( rootpixmap, &pmap_w, &pmap_h ))
2576 {
2577 int root_x = 0, root_y = 0;
2578
2579 shade.shading = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
2580 if (ISSET_PIXCOLOR (Color_tint))
2581 {
2582 rgba c;
2583 pix_colors_focused [Color_tint].get (c);
2584 shade.tintColor.red = c.r;
2585 shade.tintColor.green = c.g;
2586 shade.tintColor.blue = c.b;
2587 }
2588 else
2589 shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF;
2590 tint = shading2tint32( &shade );
2591 gc = XCreateGC (dpy, vt, 0UL, &gcvalue);
2592 if (GetWinPosition (parent[0], &root_x, &root_y) )
2593 {
2594 ASImageLayer *layers = create_image_layers( 2 );
2595 ASImage *merged_im = NULL;
2596 int back_x, back_y, back_w, back_h;
2597 /* merge_layers does good job at tiling background appropriately,
2598 so all we need is to cut out smallest possible piece : */
2599#define MAKE_ROOTPMAP_GEOM(xy,wh,widthheight) \
2600 do{ while( root_##xy < 0 ) root_##xy += (int)wrootattr.widthheight; \
2601 back_##xy = root_##xy % pmap_##wh; /* that gives us left side of the closest tile : */ \
2602 if( pmap_##wh >= back_##xy + szHint.widthheight ) \
2603 back_##wh = szHint.widthheight;/* background is large - limit it by our size */ \
2604 else \
2605 { /* small background - need the whole of it for successfull tiling :*/ \
2606 back_##xy = 0; \
2607 back_##wh = pmap_##wh; \
2608 }}while(0)
2609
2610 MAKE_ROOTPMAP_GEOM(x,w,width);
2611 MAKE_ROOTPMAP_GEOM(y,h,height);
2612
2613 layers[0].im = pixmap2asimage (display->asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100);
2614 layers[0].clip_x = (back_w == pmap_w)?root_x:0;
2615 layers[0].clip_y = (back_h == pmap_h)?root_y:0;
2616 layers[0].clip_width = szHint.width;
2617 layers[0].clip_height = szHint.height;
2618 layers[0].tint = tint;
2619 if (rs[Rs_blurradius] && layers[0].im)
2620 {
2621 double r = atof(rs[Rs_blurradius]);
2622 ASImage* tmp = blur_asimage_gauss(display->asv, layers[0].im, r, r, 0xFFFFFFFF, ASA_ASImage, 100, ASIMAGE_QUALITY_DEFAULT );
2623 if( tmp )
2624 {
2625 destroy_asimage( &layers[0].im );
2626 layers[0].im = tmp;
2627 }
2628 }
2629 if (original_asim != NULL)
2630 {
2631 int fore_w, fore_h;
2632 layers[1].im = original_asim;
2633 if( bgPixmap.auto_resize )
2634 {
2635 fore_w = szHint.width;
2636 fore_h = szHint.height;
2637 }
2638 else
2639 {
2640 fore_w = bgPixmap.w;
2641 fore_h = bgPixmap.h;
2642 }
2643 if (fore_w != original_asim->width
2644 || fore_h != original_asim->height)
2645 {
2646 layers[1].im = scale_asimage( display->asv,
2647 original_asim,
2648 fore_w, fore_h,
2649 ASA_ASImage, 100,
2650 ASIMAGE_QUALITY_DEFAULT );
2651 }
2652
2653 layers[1].clip_width = szHint.width;
2654 layers[1].clip_height = szHint.height;
2655
2656 if (rs[Rs_blendtype])
2657 {
2658 layers[1].merge_scanlines = blend_scanlines_name2func(rs[Rs_blendtype]);
2659 if( layers[1].merge_scanlines == NULL )
2660 layers[1].merge_scanlines = alphablend_scanlines;
2661 }
2662 }
2663 merged_im = merge_layers( display->asv, layers, layers[1].im?2:1,
2664 szHint.width, szHint.height,
2665 ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT );
2666 if (layers[1].im != original_asim)
2667 destroy_asimage( &(layers[1].im) );
2668 destroy_asimage( &(layers[0].im) );
2669 if (merged_im != NULL)
2670 {
2671 tmp_pmap = asimage2pixmap( display->asv, DefaultRootWindow(dpy), merged_im, gc, True );
2672 destroy_asimage( &merged_im );
2673 }
2674 free( layers );
2675 }
2676 }
2677 if (tmp_pmap != None)
2678 {
2679 success = True;
2680 if (pixmap != None)
2681 XFreePixmap (dpy, pixmap);
2682 pixmap = tmp_pmap;
2683 }
2684 }
2685#else /* HAVE_AFTERIMAGE */
2686 {
2687 /*
2688 * Copy display->root pixmap transparency
2689 */
2690 int nx, ny;
2691 unsigned int nw, nh;
2692 XImage *image;
2693
2694 nw = (unsigned int)szHint.width;
2695 nh = (unsigned int)szHint.height;
2696 nx = ny = 0;
2697
2698 if (sx < 0)
2699 {
2700 nw += sx;
2701 nx = -sx;
2702 sx = 0;
2703 }
2704
2705 if (sy < 0)
2706 {
2707 nh += sy;
2708 ny = -sy;
2709 sy = 0;
2710 }
2711
2712 min_it (nw, (unsigned int) (wrootattr.width - sx));
2713 min_it (nh, (unsigned int) (wrootattr.height - sy));
2714
2715 XSync (dpy, False);
2716 allowedxerror = -1;
2717 image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap);
2718
2719 /* XXX: handle BadMatch - usually because we're outside the pixmap */
2720 /* XXX: may need a delay here? */
2721 allowedxerror = 0;
2722 if (image != NULL)
2723 {
2724 if (pixmap != None)
2725 XFreePixmap (dpy, pixmap);
2726
2727#if TINTING
2728 if (ISSET_PIXCOLOR (Color_tint))
2729 {
2730 int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;
2731
2732 rgba c;
2733 pix_colors_focused [Color_tint].get (c);
2734 ShadeXImage (this, image, shade, c.r, c.g, c.b);
2735 }
2736#endif
2737
2738 pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth);
2739 gc = XCreateGC (dpy, vt, 0UL, &gcvalue);
2740 XPutImage (dpy, pixmap, gc, image, 0, 0,
2741 nx, ny, image->width, image->height);
2742 XDestroyImage (image);
2743 success = True ;
2744 }
2745 }
2746#endif /* HAVE_AFTERIMAGE */
2747 if (gc != NULL)
2748 XFreeGC (dpy, gc);
2749
2750 if (!success)
2751 {
2752 if (am_transparent && am_pixmap_trans)
2753 {
2754 pchanged = 1;
2755 if (pixmap != None)
2756 {
2757 XFreePixmap (dpy, pixmap);
2758 pixmap = None;
2759 }
2760 }
2761
2762 am_pixmap_trans = 0;
2763 }
2764 else
2765 {
2766 XSetWindowBackgroundPixmap (dpy, parent[0], pixmap);
2767 XClearWindow (dpy, parent[0]);
2768
2769 if (!am_transparent || !am_pixmap_trans)
2770 pchanged = 1;
2771
2772 am_transparent = am_pixmap_trans = 1;
2773 }
2774 }
2775
2776 if (am_pixmap_trans)
2777 XSetWindowBackgroundPixmap (dpy, vt, ParentRelative);
2778 else
2779 {
2780 unsigned int n;
2781 /*
2782 * InheritPixmap transparency
2783 */
2784 for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++)
2785 {
2786 oldp = parent[i];
2787 XQueryTree (dpy, parent[i - 1], &root, &parent[i], &list, &n);
2788 XFree (list);
2789
2790 if (parent[i] == display->root)
2791 {
2792 if (oldp != None)
2793 pchanged = 1;
2794
2795 break;
2796 }
2797
2798 if (oldp != parent[i])
2799 pchanged = 1;
2800 }
2801
2802 n = 0;
2803
2804 if (pchanged)
2805 for (; n < (unsigned int)i; n++)
2806 {
2807 XGetWindowAttributes (dpy, parent[n], &wattr);
2808
2809 if (wattr.depth != rootdepth || wattr.c_class == InputOnly)
2810 {
2811 n = (int) (sizeof (parent) / sizeof (Window)) + 1;
2812 break;
2813 }
2814 }
2815
2816 if (n > (sizeof (parent) / sizeof (parent[0])))
2817 {
2818 XSetWindowBackground (dpy, parent[0], pix_colors_focused[Color_border]);
2819 XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]);
2820 am_transparent = 0;
2821 /* XXX: also turn off Opt_transparent? */
2822 }
2823 else
2824 {
2825 for (n = 0; n < (unsigned int)i; n++)
2826 {
2827 XSetWindowBackgroundPixmap (dpy, parent[n], ParentRelative);
2828 XClearWindow (dpy, parent[n]);
2829 }
2830
2831 XSetWindowBackgroundPixmap (dpy, vt, ParentRelative);
2832 am_transparent = 1;
2833 }
2834
2835 for (; i < (int) (sizeof (parent) / sizeof (Window)); i++)
2836 parent[i] = None;
2837 }
2838
2839 if (scrollBar.win)
2840 {
2841 XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative);
2842 scrollBar.setIdle ();
2843 scrollbar_show (0);
2844 }
2845
2846 if (am_transparent)
2847 {
2848 want_refresh = want_full_refresh = 1;
2849 if (am_pixmap_trans)
2850 flush ();
2851 }
2852
2853// return pchanged;
2854}
2855#endif
2856
2857/*}}} */ 2222/*}}} */
2858 2223
2859bool 2224bool
2860rxvt_term::cmd_parse () 2225rxvt_term::cmd_parse ()
2861{ 2226{
2909 if (ch == C0_LF) 2274 if (ch == C0_LF)
2910 nlines++; 2275 nlines++;
2911 2276
2912 refresh_count++; 2277 refresh_count++;
2913 2278
2914 if (!option (Opt_jumpScroll) 2279 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2915 || (refresh_count >= refresh_limit * (nrow - 1)))
2916 { 2280 {
2917 refreshnow = true;
2918 refresh_count = 0; 2281 refresh_count = 0;
2282
2283 if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.)
2284 {
2285 refreshnow = true;
2919 ch = NOCHAR; 2286 ch = NOCHAR;
2920 break; 2287 break;
2288 }
2921 } 2289 }
2922 2290
2923 // scr_add_lines only works for nlines <= nrow - 1. 2291 // scr_add_lines only works for nlines <= nrow - 1.
2924 if (nlines >= nrow - 1) 2292 if (nlines >= nrow - 1)
2925 { 2293 {
2953 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) 2321 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END))))
2954 scr_add_lines (buf, str - buf, nlines); 2322 scr_add_lines (buf, str - buf, nlines);
2955 2323
2956 /* 2324 /*
2957 * If there have been a lot of new lines, then update the screen 2325 * If there have been a lot of new lines, then update the screen
2958 * What the heck I'll cheat and only refresh less than every page-full. 2326 * What the heck we'll cheat and only refresh less than every page-full.
2959 * the number of pages between refreshes is refresh_limit, which 2327 * if skipScroll is enabled.
2960 * is incremented here because we must be doing flat-out scrolling.
2961 */ 2328 */
2962 if (refreshnow) 2329 if (refreshnow)
2963 { 2330 {
2964 if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2965 refresh_limit++;
2966 else
2967 {
2968 flag = true; 2331 flag = true;
2969 //TODO: due to popular request, implement "skipscroll" option here
2970 scr_refresh (); 2332 scr_refresh ();
2971 want_refresh = 1; 2333 want_refresh = 1;
2972 }
2973 } 2334 }
2974 2335
2975 } 2336 }
2976 else 2337 else
2977 { 2338 {
3126 { 2487 {
3127 if ((buf[len++] = cmd_getc ()) == 'i') 2488 if ((buf[len++] = cmd_getc ()) == 'i')
3128 break; /* done = 1 */ 2489 break; /* done = 1 */
3129 } 2490 }
3130 } 2491 }
3131 2492
3132 for (i = 0; i < len; i++) 2493 for (i = 0; i < len; i++)
3133 if (putc (buf[i], fd) == EOF) 2494 if (putc (buf[i], fd) == EOF)
3134 { 2495 {
3135 done = 1; 2496 done = 1;
3136 break; 2497 break;
3198 process_dcs_seq (); 2559 process_dcs_seq ();
3199 break; 2560 break;
3200 case 0x9b: /* CSI */ 2561 case 0x9b: /* CSI */
3201 process_csi_seq (); 2562 process_csi_seq ();
3202 break; 2563 break;
3203 case 0x9d: /* CSI */ 2564 case 0x9d: /* OSC */
3204 process_osc_seq (); 2565 process_osc_seq ();
3205 break; 2566 break;
3206#endif 2567#endif
3207 } 2568 }
3208} 2569}
3434rxvt_term::process_csi_seq () 2795rxvt_term::process_csi_seq ()
3435{ 2796{
3436 unicode_t ch, priv, i; 2797 unicode_t ch, priv, i;
3437 unsigned int nargs, p; 2798 unsigned int nargs, p;
3438 int n, ndef; 2799 int n, ndef;
3439 int arg[ESC_ARGS]; 2800 int arg[ESC_ARGS] = { };
3440 2801
3441 for (nargs = ESC_ARGS; nargs > 0;) 2802 nargs = 0;
3442 arg[--nargs] = 0;
3443 2803
3444 priv = 0; 2804 priv = 0;
3445 ch = cmd_getc (); 2805 ch = cmd_getc ();
3446 if (ch >= '<' && ch <= '?') 2806 if (ch >= '<' && ch <= '?')
3447 { /* '<' '=' '>' '?' */ 2807 { /* '<' '=' '>' '?' */
3491 switch (priv) 2851 switch (priv)
3492 { 2852 {
3493 case '>': 2853 case '>':
3494 if (ch == CSI_DA) /* secondary device attributes */ 2854 if (ch == CSI_DA) /* secondary device attributes */
3495 { 2855 {
3496 // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, 2856 // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt,
3497 // 'U' for rxvt-unicode != 7.[34] (where it was broken). 2857 // 'U' for rxvt-unicode != 7.[34] (where it was broken).
3498 // 2858 //
3499 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt 2859 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt
3500 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify 2860 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify
3501 // that we do not support xterm mouse reporting (should be 95 when we do). 2861 // that we do not support xterm mouse reporting (should be 95 when we do).
3954 int saveop = op; 3314 int saveop = op;
3955 3315
3956 dLocal (Display *, dpy); 3316 dLocal (Display *, dpy);
3957 3317
3958 assert (str != NULL); 3318 assert (str != NULL);
3959 3319
3960 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) 3320 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END)))
3961 return; 3321 return;
3962 3322
3963 switch (op) 3323 switch (op)
3964 { 3324 {
4059 break; 3419 break;
4060 case URxvt_Color_IT: 3420 case URxvt_Color_IT:
4061 process_color_seq (op, Color_IT, str, resp); 3421 process_color_seq (op, Color_IT, str, resp);
4062 break; 3422 break;
4063#endif 3423#endif
4064#if TRANSPARENT && TINTING 3424#if ENABLE_TRANSPARENCY
4065 case URxvt_Color_tint: 3425 case URxvt_Color_tint:
4066 process_color_seq (op, Color_tint, str, resp); 3426 process_color_seq (op, Color_tint, str, resp);
3427 {
3428 bool changed = false;
3429 if (ISSET_PIXCOLOR (Color_tint))
3430 changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]);
3431 else
3432 changed = bgPixmap.unset_tint ();
3433 if (changed)
3434 update_background ();
3435 }
4067 3436
4068 check_our_parents ();
4069
4070 if (am_transparent)
4071 want_full_refresh = want_refresh = 1;
4072
4073 break; 3437 break;
4074#endif 3438#endif
4075 3439
3440#if XPM_BACKGROUND
4076 case Rxvt_Pixmap: 3441 case Rxvt_Pixmap:
4077 { 3442 if (!strcmp (str, "?"))
4078 if (*str != ';')
4079 { 3443 {
4080#if XPM_BACKGROUND 3444 char str[256];
4081 scale_pixmap (""); /* reset to default scaling */ 3445
4082 set_bgPixmap (str); /* change pixmap */ 3446 sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */
4083 scr_touch (true); 3447 min (bgPixmap.h_scale, 32767), min (bgPixmap.v_scale, 32767),
4084#endif 3448 min (bgPixmap.h_align, 32767), min (bgPixmap.v_align, 32767));
3449 process_xterm_seq (XTerm_title, str, CHAR_ST);
4085 } 3450 }
4086 3451 else
3452 {
4087 int changed = 0; 3453 int changed = 0;
4088 3454
4089 while ((str = strchr (str, ';')) != NULL) 3455 if (*str != ';')
4090 { 3456 {
3457 /* reset to default scaling :*/
3458 bgPixmap.unset_geometry ();
3459 if (bgPixmap.set_file (str)) /* change pixmap */
3460 changed++;
3461 str = strchr (str, ';');
3462 if (str == NULL)
3463 bgPixmap.set_defaultGeometry ();
3464 }
3465 while (str)
3466 {
4091 str++; 3467 str++;
4092#if XPM_BACKGROUND 3468 if (bgPixmap.set_geometry (str))
4093 changed += scale_pixmap (str); 3469 changed++;
4094#endif 3470 str = strchr (str, ';');
4095 } 3471 }
4096
4097 if (changed) 3472 if (changed)
4098 { 3473 update_background ();
4099#ifdef XPM_BACKGROUND
4100 resize_pixmap ();
4101 scr_touch (true);
4102#endif
4103 } 3474 }
4104#if TRANSPARENT && defined(HAVE_AFTERIMAGE) 3475 break;
4105 if (option(Opt_transparent))
4106 check_our_parents ();
4107#endif 3476#endif
4108
4109 }
4110 break;
4111 3477
4112 case Rxvt_restoreFG: 3478 case Rxvt_restoreFG:
4113 set_window_color (Color_fg, str); 3479 set_window_color (Color_fg, str);
4114 break; 3480 break;
4115 case Rxvt_restoreBG: 3481 case Rxvt_restoreBG:
4237{ 3603{
4238 unsigned int i, j; 3604 unsigned int i, j;
4239 int state; 3605 int state;
4240 3606
4241 static const struct 3607 static const struct
4242 { 3608 {
4243 const int argval; 3609 const int argval;
4244 const unsigned long bit; 3610 const unsigned long bit;
4245 }
4246
4247 argtopriv[] = { 3611 } argtopriv[] = {
4248 { 1, PrivMode_aplCUR }, 3612 { 1, PrivMode_aplCUR },
4249 { 2, PrivMode_vt52 }, 3613 { 2, PrivMode_vt52 },
4250 { 3, PrivMode_132 }, 3614 { 3, PrivMode_132 },
4251 { 4, PrivMode_smoothScroll }, 3615 { 4, PrivMode_smoothScroll },
4252 { 5, PrivMode_rVideo }, 3616 { 5, PrivMode_rVideo },

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines