… | |
… | |
638 | XSetIOErrorHandler (rxvt_xioerror_handler); |
638 | XSetIOErrorHandler (rxvt_xioerror_handler); |
639 | |
639 | |
640 | XrmInitialize (); |
640 | XrmInitialize (); |
641 | } |
641 | } |
642 | |
642 | |
643 | /* ------------------------------------------------------------------------- * |
|
|
644 | * MEMORY ALLOCATION WRAPPERS * |
|
|
645 | * ------------------------------------------------------------------------- */ |
|
|
646 | void * |
|
|
647 | rxvt_malloc (size_t size) |
|
|
648 | { |
|
|
649 | void *p = malloc (size); |
|
|
650 | |
|
|
651 | if (!p) |
|
|
652 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
|
|
653 | |
|
|
654 | return p; |
|
|
655 | } |
|
|
656 | |
|
|
657 | void * |
|
|
658 | rxvt_calloc (size_t number, size_t size) |
|
|
659 | { |
|
|
660 | void *p = calloc (number, size); |
|
|
661 | |
|
|
662 | if (!p) |
|
|
663 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
|
|
664 | |
|
|
665 | return p; |
|
|
666 | } |
|
|
667 | |
|
|
668 | void * |
|
|
669 | rxvt_realloc (void *ptr, size_t size) |
|
|
670 | { |
|
|
671 | void *p = realloc (ptr, size); |
|
|
672 | |
|
|
673 | if (!p) |
|
|
674 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
|
|
675 | |
|
|
676 | return p; |
|
|
677 | } |
|
|
678 | |
|
|
679 | /*----------------------------------------------------------------------*/ |
643 | /*----------------------------------------------------------------------*/ |
680 | /* |
644 | /* |
681 | * window size/position calculations for XSizeHint and other storage. |
645 | * window size/position calculations for XSizeHint and other storage. |
682 | * if width/height are non-zero then override calculated width/height |
646 | * if width/height are non-zero then override calculated width/height |
683 | */ |
647 | */ |
… | |
… | |
1713 | void |
1677 | void |
1714 | rxvt_term::get_window_origin (int &x, int &y) |
1678 | rxvt_term::get_window_origin (int &x, int &y) |
1715 | { |
1679 | { |
1716 | Window cr; |
1680 | Window cr; |
1717 | XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); |
1681 | XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); |
1718 | /* fprintf( stderr, "origin is %+d%+d\n", x, y);*/ |
1682 | /* fprintf (stderr, "origin is %+d%+d\n", x, y);*/ |
1719 | } |
1683 | } |
1720 | |
1684 | |
1721 | Pixmap |
1685 | Pixmap |
1722 | rxvt_term::get_pixmap_property (int prop_id) |
1686 | rxvt_term::get_pixmap_property (int prop_id) |
1723 | { |
1687 | { |
… | |
… | |
1757 | /* no chance of real time refresh if we are blurring! */ |
1721 | /* no chance of real time refresh if we are blurring! */ |
1758 | if (bgPixmap.invalid_since + 0.5 < ev::now () && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
1722 | if (bgPixmap.invalid_since + 0.5 < ev::now () && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
1759 | bgPixmap.render (); |
1723 | bgPixmap.render (); |
1760 | else |
1724 | else |
1761 | { |
1725 | { |
|
|
1726 | ev_tstamp refresh; |
1762 | update_background_ev.stop (); |
1727 | update_background_ev.stop (); |
1763 | |
1728 | |
1764 | if (!bgPixmap.need_client_side_rendering ()) |
1729 | if (!bgPixmap.need_client_side_rendering ()) |
1765 | update_background_ev.start (.05); |
1730 | refresh = .05; |
1766 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
1731 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
1767 | update_background_ev.start (.20); /* very slow !!! */ |
1732 | refresh = .20; /* very slow !!! */ |
1768 | else |
1733 | else |
|
|
1734 | refresh = .07; |
1769 | update_background_ev.start (.07); |
1735 | update_background_ev.start (refresh); |
1770 | } |
1736 | } |
1771 | |
1737 | |
1772 | return 0; |
1738 | return 0; |
1773 | } |
1739 | } |
1774 | |
1740 | |