… | |
… | |
172 | #endif |
172 | #endif |
173 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
173 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
174 | rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), |
174 | rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), |
175 | #endif |
175 | #endif |
176 | scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), |
176 | scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), |
177 | #ifdef USE_XIM |
177 | #if USE_XIM |
178 | im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), |
178 | im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), |
179 | #endif |
179 | #endif |
180 | #ifdef POINTER_BLANK |
180 | #ifdef POINTER_BLANK |
181 | pointer_ev.set <rxvt_term, &rxvt_term::pointer_cb> (this); |
181 | pointer_ev.set <rxvt_term, &rxvt_term::pointer_cb> (this); |
182 | #endif |
182 | #endif |
… | |
… | |
231 | if (display) |
231 | if (display) |
232 | { |
232 | { |
233 | selection_clear (); |
233 | selection_clear (); |
234 | selection_clear (true); |
234 | selection_clear (true); |
235 | |
235 | |
236 | #ifdef USE_XIM |
236 | #if USE_XIM |
237 | im_destroy (); |
237 | im_destroy (); |
238 | #endif |
238 | #endif |
239 | scrollBar.destroy (); |
239 | scrollBar.destroy (); |
240 | if (gc) XFreeGC (dpy, gc); |
240 | if (gc) XFreeGC (dpy, gc); |
241 | |
241 | |
… | |
… | |
572 | // TODO: handle this with exceptions and tolerate the memory loss |
572 | // TODO: handle this with exceptions and tolerate the memory loss |
573 | XSetIOErrorHandler (rxvt_xioerror_handler); |
573 | XSetIOErrorHandler (rxvt_xioerror_handler); |
574 | |
574 | |
575 | XrmInitialize (); |
575 | XrmInitialize (); |
576 | |
576 | |
577 | #ifdef HAVE_PIXBUF |
577 | #if HAVE_PIXBUF |
578 | g_type_init (); |
578 | g_type_init (); |
579 | #endif |
579 | #endif |
580 | } |
580 | } |
581 | |
581 | |
582 | /*----------------------------------------------------------------------*/ |
582 | /*----------------------------------------------------------------------*/ |
… | |
… | |
965 | |
965 | |
966 | for (i = Color_Black; i <= Color_White; i++) |
966 | for (i = Color_Black; i <= Color_White; i++) |
967 | if (pix_colors[Color_bg] == pix_colors[i]) |
967 | if (pix_colors[Color_bg] == pix_colors[i]) |
968 | { |
968 | { |
969 | sprintf (bstr, "%d", i - Color_Black); |
969 | sprintf (bstr, "%d", i - Color_Black); |
970 | #ifdef BG_IMAGE_FROM_FILE |
970 | #if BG_IMAGE_FROM_FILE |
971 | xpmb = "default;"; |
971 | xpmb = "default;"; |
972 | #endif |
972 | #endif |
973 | break; |
973 | break; |
974 | } |
974 | } |
975 | |
975 | |
… | |
… | |
1078 | |
1078 | |
1079 | XMoveResizeWindow (dpy, vt, |
1079 | XMoveResizeWindow (dpy, vt, |
1080 | window_vt_x, window_vt_y, |
1080 | window_vt_x, window_vt_y, |
1081 | vt_width, vt_height); |
1081 | vt_width, vt_height); |
1082 | |
1082 | |
|
|
1083 | HOOK_INVOKE ((this, HOOK_SIZE_CHANGE, DT_INT, newwidth, DT_INT, newheight, DT_END)); |
|
|
1084 | |
1083 | #ifdef HAVE_BG_PIXMAP |
1085 | #ifdef HAVE_BG_PIXMAP |
1084 | if (bg_window_size_sensitive ()) |
1086 | if (bg_window_size_sensitive ()) |
1085 | update_background (); |
1087 | update_background (); |
1086 | #endif |
1088 | #endif |
1087 | } |
1089 | } |
1088 | |
1090 | |
1089 | if (fix_screen || old_height == 0) |
1091 | if (fix_screen || old_height == 0) |
1090 | scr_reset (); |
1092 | scr_reset (); |
1091 | |
1093 | |
1092 | #ifdef USE_XIM |
1094 | #if USE_XIM |
1093 | im_set_position (); |
1095 | im_set_position (); |
1094 | #endif |
1096 | #endif |
1095 | } |
1097 | } |
1096 | |
1098 | |
1097 | /* |
1099 | /* |
… | |
… | |
1122 | } |
1124 | } |
1123 | |
1125 | |
1124 | /* -------------------------------------------------------------------- * |
1126 | /* -------------------------------------------------------------------- * |
1125 | * - X INPUT METHOD ROUTINES - * |
1127 | * - X INPUT METHOD ROUTINES - * |
1126 | * -------------------------------------------------------------------- */ |
1128 | * -------------------------------------------------------------------- */ |
1127 | #ifdef USE_XIM |
1129 | #if USE_XIM |
1128 | |
1130 | |
1129 | void |
1131 | void |
1130 | rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) |
1132 | rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) |
1131 | { |
1133 | { |
1132 | fg = pix_colors [Color_fg]; |
1134 | fg = pix_colors [Color_fg]; |
… | |
… | |
1624 | { |
1626 | { |
1625 | Window cr; |
1627 | Window cr; |
1626 | XTranslateCoordinates (dpy, parent, display->root, 0, 0, &x, &y, &cr); |
1628 | XTranslateCoordinates (dpy, parent, display->root, 0, 0, &x, &y, &cr); |
1627 | } |
1629 | } |
1628 | |
1630 | |
1629 | Pixmap |
|
|
1630 | rxvt_term::get_pixmap_property (Atom property) |
|
|
1631 | { |
|
|
1632 | Pixmap pixmap = None; |
|
|
1633 | |
|
|
1634 | int aformat; |
|
|
1635 | unsigned long nitems, bytes_after; |
|
|
1636 | Atom atype; |
|
|
1637 | unsigned char *prop; |
|
|
1638 | int result = XGetWindowProperty (dpy, display->root, property, |
|
|
1639 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
1640 | &nitems, &bytes_after, &prop); |
|
|
1641 | if (result == Success) |
|
|
1642 | { |
|
|
1643 | if (atype == XA_PIXMAP) |
|
|
1644 | pixmap = *(Pixmap *)prop; |
|
|
1645 | XFree (prop); |
|
|
1646 | } |
|
|
1647 | |
|
|
1648 | return pixmap; |
|
|
1649 | } |
|
|
1650 | |
|
|
1651 | #ifdef HAVE_BG_PIXMAP |
1631 | #ifdef HAVE_BG_PIXMAP |
1652 | |
1632 | |
1653 | void |
1633 | void |
1654 | rxvt_term::update_background () |
1634 | rxvt_term::update_background () |
1655 | { |
1635 | { |