… | |
… | |
527 | XSelectInput (dpy, display->root, PropertyChangeMask); |
527 | XSelectInput (dpy, display->root, PropertyChangeMask); |
528 | rootwin_ev.start (display, display->root); |
528 | rootwin_ev.start (display, display->root); |
529 | } |
529 | } |
530 | #endif |
530 | #endif |
531 | |
531 | |
532 | #ifdef XPM_BACKGROUND |
532 | #ifdef BG_IMAGE_FROM_FILE |
533 | if (rs[Rs_backgroundPixmap] != NULL) |
533 | if (rs[Rs_backgroundPixmap] != NULL) |
534 | { |
534 | { |
535 | const char *p = rs[Rs_backgroundPixmap]; |
535 | const char *p = rs[Rs_backgroundPixmap]; |
536 | |
536 | |
537 | if ((p = strchr (p, ';')) != NULL) |
537 | if ((p = strchr (p, ';')) != NULL) |
… | |
… | |
541 | } |
541 | } |
542 | else |
542 | else |
543 | bgPixmap.set_defaultGeometry (); |
543 | bgPixmap.set_defaultGeometry (); |
544 | |
544 | |
545 | if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) |
545 | if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) |
546 | if (!option (Opt_transparent)) |
546 | if (!bgPixmap.window_position_sensitive ()) |
547 | update_background (); |
547 | update_background (); |
548 | } |
548 | } |
549 | #endif |
549 | #endif |
550 | } |
550 | } |
551 | #endif |
551 | #endif |
… | |
… | |
1038 | |
1038 | |
1039 | for (i = Color_Black; i <= Color_White; i++) |
1039 | for (i = Color_Black; i <= Color_White; i++) |
1040 | if (pix_colors[Color_bg] == pix_colors[i]) |
1040 | if (pix_colors[Color_bg] == pix_colors[i]) |
1041 | { |
1041 | { |
1042 | sprintf (bstr, "%d", (i - Color_Black)); |
1042 | sprintf (bstr, "%d", (i - Color_Black)); |
1043 | #ifdef XPM_BACKGROUND |
1043 | #ifdef BG_IMAGE_FROM_FILE |
1044 | xpmb = "default;"; |
1044 | xpmb = "default;"; |
1045 | #endif |
1045 | #endif |
1046 | break; |
1046 | break; |
1047 | } |
1047 | } |
1048 | |
1048 | |
… | |
… | |
1146 | window_vt_x, window_vt_y, |
1146 | window_vt_x, window_vt_y, |
1147 | width, height); |
1147 | width, height); |
1148 | |
1148 | |
1149 | #ifdef HAVE_BG_PIXMAP |
1149 | #ifdef HAVE_BG_PIXMAP |
1150 | if (bgPixmap.window_size_sensitive ()) |
1150 | if (bgPixmap.window_size_sensitive ()) |
1151 | update_background (); |
1151 | update_background (); |
1152 | #endif |
1152 | #endif |
1153 | |
1153 | |
1154 | scr_clear (); |
1154 | scr_clear (); |
1155 | } |
1155 | } |
1156 | |
1156 | |
… | |
… | |
1700 | |
1700 | |
1701 | XFree (preedit_attr); |
1701 | XFree (preedit_attr); |
1702 | } |
1702 | } |
1703 | #endif /* USE_XIM */ |
1703 | #endif /* USE_XIM */ |
1704 | |
1704 | |
|
|
1705 | void |
|
|
1706 | rxvt_term::get_window_origin (int &x, int &y) |
|
|
1707 | { |
|
|
1708 | Window cr; |
|
|
1709 | XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); |
|
|
1710 | /* fprintf( stderr, "origin is %+d%+d\n", x, y);*/ |
|
|
1711 | } |
|
|
1712 | |
|
|
1713 | Pixmap |
|
|
1714 | rxvt_term::get_pixmap_property (int prop_id) |
|
|
1715 | { |
|
|
1716 | if (prop_id > 0 && prop_id < NUM_XA) |
|
|
1717 | if (xa[prop_id]) |
|
|
1718 | { |
|
|
1719 | int aformat; |
|
|
1720 | unsigned long nitems, bytes_after; |
|
|
1721 | Atom atype; |
|
|
1722 | unsigned char *prop = NULL; |
|
|
1723 | int result = XGetWindowProperty (dpy, display->root, xa[prop_id], |
|
|
1724 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
1725 | &nitems, &bytes_after, &prop); |
|
|
1726 | if (result == Success && prop && atype == XA_PIXMAP) |
|
|
1727 | { |
|
|
1728 | return *(Pixmap *)prop; |
|
|
1729 | } |
|
|
1730 | } |
|
|
1731 | return None; |
|
|
1732 | } |
|
|
1733 | |
|
|
1734 | #ifdef HAVE_BG_PIXMAP |
|
|
1735 | int |
|
|
1736 | rxvt_term::update_background () |
|
|
1737 | { |
|
|
1738 | bgPixmap.invalidate (); |
|
|
1739 | |
|
|
1740 | /* no chance of real time refresh if we are blurring ! */ |
|
|
1741 | if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
|
|
1742 | bgPixmap.render (); |
|
|
1743 | else |
|
|
1744 | { |
|
|
1745 | update_background_ev.stop (); |
|
|
1746 | if (!bgPixmap.need_client_side_rendering()) |
|
|
1747 | update_background_ev.start (NOW + .05); |
|
|
1748 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
|
|
1749 | update_background_ev.start (NOW + .2); /* very slow !!! */ |
|
|
1750 | else |
|
|
1751 | update_background_ev.start (NOW + .07); |
|
|
1752 | } |
|
|
1753 | return 0; |
|
|
1754 | } |
|
|
1755 | |
|
|
1756 | void |
|
|
1757 | rxvt_term::update_background_cb (time_watcher &w) |
|
|
1758 | { |
|
|
1759 | bgPixmap.render (); |
|
|
1760 | } |
|
|
1761 | |
|
|
1762 | #endif /* HAVE_BG_PIXMAP */ |
|
|
1763 | |
1705 | /*----------------------- end-of-file (C source) -----------------------*/ |
1764 | /*----------------------- end-of-file (C source) -----------------------*/ |