… | |
… | |
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 |
… | |
… | |
942 | #if ENABLE_EWMH |
942 | #if ENABLE_EWMH |
943 | set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); |
943 | set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); |
944 | #endif |
944 | #endif |
945 | } |
945 | } |
946 | |
946 | |
|
|
947 | void |
|
|
948 | rxvt_term::set_window_color (int idx, const char *color) |
|
|
949 | { |
947 | #ifdef XTERM_COLOR_CHANGE |
950 | #ifdef XTERM_COLOR_CHANGE |
948 | void |
|
|
949 | rxvt_term::set_window_color (int idx, const char *color) |
|
|
950 | { |
|
|
951 | rxvt_color xcol; |
951 | rxvt_color xcol; |
952 | int i; |
952 | int i; |
953 | |
953 | |
954 | if (color == NULL || *color == '\0') |
954 | if (color == NULL || *color == '\0') |
955 | return; |
955 | return; |
… | |
… | |
992 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
992 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
993 | |
993 | |
994 | update_fade_color (idx); |
994 | update_fade_color (idx); |
995 | recolour_cursor (); |
995 | recolour_cursor (); |
996 | scr_recolour (); |
996 | scr_recolour (); |
997 | } |
|
|
998 | |
|
|
999 | #else |
|
|
1000 | # define set_window_color (idx,color) ((void)0) |
|
|
1001 | #endif /* XTERM_COLOR_CHANGE */ |
997 | #endif /* XTERM_COLOR_CHANGE */ |
|
|
998 | } |
1002 | |
999 | |
1003 | void |
1000 | void |
1004 | rxvt_term::recolour_cursor () |
1001 | rxvt_term::recolour_cursor () |
1005 | { |
1002 | { |
1006 | XColor fg, bg; |
1003 | XColor fg, bg; |
… | |
… | |
1038 | |
1035 | |
1039 | for (i = Color_Black; i <= Color_White; i++) |
1036 | for (i = Color_Black; i <= Color_White; i++) |
1040 | if (pix_colors[Color_bg] == pix_colors[i]) |
1037 | if (pix_colors[Color_bg] == pix_colors[i]) |
1041 | { |
1038 | { |
1042 | sprintf (bstr, "%d", (i - Color_Black)); |
1039 | sprintf (bstr, "%d", (i - Color_Black)); |
1043 | #ifdef XPM_BACKGROUND |
1040 | #ifdef BG_IMAGE_FROM_FILE |
1044 | xpmb = "default;"; |
1041 | xpmb = "default;"; |
1045 | #endif |
1042 | #endif |
1046 | break; |
1043 | break; |
1047 | } |
1044 | } |
1048 | |
1045 | |
… | |
… | |
1144 | |
1141 | |
1145 | XMoveResizeWindow (dpy, vt, |
1142 | XMoveResizeWindow (dpy, vt, |
1146 | window_vt_x, window_vt_y, |
1143 | window_vt_x, window_vt_y, |
1147 | width, height); |
1144 | width, height); |
1148 | |
1145 | |
1149 | #ifdef XPM_BACKGROUND |
1146 | #ifdef HAVE_BG_PIXMAP |
1150 | if (bgPixmap.window_size_sensitive ()) |
1147 | if (bgPixmap.window_size_sensitive ()) |
1151 | update_background (); |
1148 | update_background (); |
1152 | #endif |
1149 | #endif |
1153 | |
1150 | |
1154 | scr_clear (); |
1151 | scr_clear (); |
1155 | } |
1152 | } |
1156 | |
1153 | |
… | |
… | |
1700 | |
1697 | |
1701 | XFree (preedit_attr); |
1698 | XFree (preedit_attr); |
1702 | } |
1699 | } |
1703 | #endif /* USE_XIM */ |
1700 | #endif /* USE_XIM */ |
1704 | |
1701 | |
|
|
1702 | void |
|
|
1703 | rxvt_term::get_window_origin (int &x, int &y) |
|
|
1704 | { |
|
|
1705 | Window cr; |
|
|
1706 | XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); |
|
|
1707 | /* fprintf( stderr, "origin is %+d%+d\n", x, y);*/ |
|
|
1708 | } |
|
|
1709 | |
|
|
1710 | Pixmap |
|
|
1711 | rxvt_term::get_pixmap_property (int prop_id) |
|
|
1712 | { |
|
|
1713 | if (prop_id > 0 && prop_id < NUM_XA) |
|
|
1714 | if (xa[prop_id]) |
|
|
1715 | { |
|
|
1716 | int aformat; |
|
|
1717 | unsigned long nitems, bytes_after; |
|
|
1718 | Atom atype; |
|
|
1719 | unsigned char *prop = NULL; |
|
|
1720 | int result = XGetWindowProperty (dpy, display->root, xa[prop_id], |
|
|
1721 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
1722 | &nitems, &bytes_after, &prop); |
|
|
1723 | if (result == Success && prop && atype == XA_PIXMAP) |
|
|
1724 | { |
|
|
1725 | return *(Pixmap *)prop; |
|
|
1726 | } |
|
|
1727 | } |
|
|
1728 | return None; |
|
|
1729 | } |
|
|
1730 | |
|
|
1731 | #ifdef HAVE_BG_PIXMAP |
|
|
1732 | int |
|
|
1733 | rxvt_term::update_background () |
|
|
1734 | { |
|
|
1735 | bgPixmap.invalidate (); |
|
|
1736 | |
|
|
1737 | /* no chance of real time refresh if we are blurring ! */ |
|
|
1738 | if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
|
|
1739 | bgPixmap.render (); |
|
|
1740 | else |
|
|
1741 | { |
|
|
1742 | update_background_ev.stop (); |
|
|
1743 | if (!bgPixmap.need_client_side_rendering()) |
|
|
1744 | update_background_ev.start (NOW + .05); |
|
|
1745 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
|
|
1746 | update_background_ev.start (NOW + .2); /* very slow !!! */ |
|
|
1747 | else |
|
|
1748 | update_background_ev.start (NOW + .07); |
|
|
1749 | } |
|
|
1750 | return 0; |
|
|
1751 | } |
|
|
1752 | |
|
|
1753 | void |
|
|
1754 | rxvt_term::update_background_cb (time_watcher &w) |
|
|
1755 | { |
|
|
1756 | bgPixmap.render (); |
|
|
1757 | } |
|
|
1758 | |
|
|
1759 | #endif /* HAVE_BG_PIXMAP */ |
|
|
1760 | |
1705 | /*----------------------- end-of-file (C source) -----------------------*/ |
1761 | /*----------------------- end-of-file (C source) -----------------------*/ |