… | |
… | |
579 | XFlush (dpy); |
579 | XFlush (dpy); |
580 | } |
580 | } |
581 | |
581 | |
582 | void rxvt_display::reg (xevent_watcher *w) |
582 | void rxvt_display::reg (xevent_watcher *w) |
583 | { |
583 | { |
|
|
584 | if (!w->active) |
|
|
585 | { |
584 | xw.push_back (w); |
586 | xw.push_back (w); |
585 | w->active = xw.size (); |
587 | w->active = xw.size (); |
|
|
588 | } |
586 | } |
589 | } |
587 | |
590 | |
588 | void rxvt_display::unreg (xevent_watcher *w) |
591 | void rxvt_display::unreg (xevent_watcher *w) |
589 | { |
592 | { |
590 | if (w->active) |
593 | if (w->active) |
|
|
594 | { |
591 | xw[w->active - 1] = 0; |
595 | xw[w->active - 1] = 0; |
|
|
596 | w->active = 0; |
|
|
597 | } |
592 | } |
598 | } |
593 | |
599 | |
594 | void rxvt_display::set_selection_owner (rxvt_term *owner) |
600 | void rxvt_display::set_selection_owner (rxvt_term *owner) |
595 | { |
601 | { |
596 | if (selection_owner && selection_owner != owner) |
602 | if (selection_owner && selection_owner != owner) |
… | |
… | |
803 | //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", |
809 | //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", |
804 | // color.r, color.g, color.b, best->red, best->green, best->blue, diff); |
810 | // color.r, color.g, color.b, best->red, best->green, best->blue, diff); |
805 | |
811 | |
806 | got = alloc (screen, rgba (best->red, best->green, best->blue)); |
812 | got = alloc (screen, rgba (best->red, best->green, best->blue)); |
807 | |
813 | |
808 | delete colors; |
814 | delete [] colors; |
809 | } |
815 | } |
810 | #endif |
816 | #endif |
811 | |
817 | |
812 | return got; |
818 | return got; |
813 | } |
819 | } |