… | |
… | |
189 | bell_ev (this, &rxvt_term::bell_cb), |
189 | bell_ev (this, &rxvt_term::bell_cb), |
190 | #endif |
190 | #endif |
191 | termwin_ev (this, &rxvt_term::x_cb), |
191 | termwin_ev (this, &rxvt_term::x_cb), |
192 | vt_ev (this, &rxvt_term::x_cb), |
192 | vt_ev (this, &rxvt_term::x_cb), |
193 | child_ev (this, &rxvt_term::child_cb), |
193 | child_ev (this, &rxvt_term::child_cb), |
194 | check_ev (this, &rxvt_term::check_cb), |
194 | prepare_ev (this, &rxvt_term::prepare_cb), |
195 | flush_ev (this, &rxvt_term::flush_cb), |
195 | flush_ev (this, &rxvt_term::flush_cb), |
196 | destroy_ev (this, &rxvt_term::destroy_cb), |
196 | destroy_ev (this, &rxvt_term::destroy_cb), |
197 | pty_ev (this, &rxvt_term::pty_cb), |
197 | pty_ev (this, &rxvt_term::pty_cb), |
198 | incr_ev (this, &rxvt_term::incr_cb) |
198 | incr_ev (this, &rxvt_term::incr_cb) |
199 | { |
199 | { |
… | |
… | |
310 | #endif |
310 | #endif |
311 | } |
311 | } |
312 | |
312 | |
313 | // child has exited, usually destroys |
313 | // child has exited, usually destroys |
314 | void |
314 | void |
315 | rxvt_term::child_cb (child_watcher &w, int status) |
315 | rxvt_term::child_cb (ev::child &w, int status) |
316 | { |
316 | { |
317 | HOOK_INVOKE ((this, HOOK_CHILD_EXIT, DT_INT, status, DT_END)); |
317 | HOOK_INVOKE ((this, HOOK_CHILD_EXIT, DT_INT, status, DT_END)); |
318 | |
318 | |
319 | cmd_pid = 0; |
319 | cmd_pid = 0; |
320 | |
320 | |
… | |
… | |
348 | incr_ev.stop (); |
348 | incr_ev.stop (); |
349 | termwin_ev.stop (display); |
349 | termwin_ev.stop (display); |
350 | vt_ev.stop (display); |
350 | vt_ev.stop (display); |
351 | } |
351 | } |
352 | |
352 | |
353 | check_ev.stop (); |
353 | prepare_ev.stop (); |
354 | pty_ev.stop (); |
354 | pty_ev.stop (); |
355 | #ifdef CURSOR_BLINK |
355 | #ifdef CURSOR_BLINK |
356 | cursor_blink_ev.stop (); |
356 | cursor_blink_ev.stop (); |
357 | #endif |
357 | #endif |
358 | #ifdef TEXT_BLINK |
358 | #ifdef TEXT_BLINK |
… | |
… | |
366 | #endif |
366 | #endif |
367 | #ifdef POINTER_BLANK |
367 | #ifdef POINTER_BLANK |
368 | pointer_ev.stop (); |
368 | pointer_ev.stop (); |
369 | #endif |
369 | #endif |
370 | |
370 | |
371 | destroy_ev.start (0); |
371 | destroy_ev.start (); |
372 | } |
372 | } |
373 | |
373 | |
374 | void |
374 | void |
375 | rxvt_term::destroy_cb (time_watcher &w) |
375 | rxvt_term::destroy_cb (ev::check &w, int revents) |
376 | { |
376 | { |
377 | make_current (); |
377 | make_current (); |
378 | |
378 | |
379 | delete this; |
379 | delete this; |
380 | } |
380 | } |
… | |
… | |
565 | init_command (cmd_argv); |
565 | init_command (cmd_argv); |
566 | |
566 | |
567 | free (cmd_argv); |
567 | free (cmd_argv); |
568 | |
568 | |
569 | if (pty->pty >= 0) |
569 | if (pty->pty >= 0) |
570 | pty_ev.start (pty->pty, EVENT_READ); |
570 | pty_ev.start (pty->pty, ev::READ); |
571 | |
571 | |
572 | check_ev.start (); |
572 | prepare_ev.start (); |
573 | |
573 | |
574 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
574 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
575 | |
575 | |
576 | #if ENABLE_XEMBED |
576 | #if ENABLE_XEMBED |
577 | if (rs[Rs_embed]) |
577 | if (rs[Rs_embed]) |
… | |
… | |
589 | return true; |
589 | return true; |
590 | } |
590 | } |
591 | |
591 | |
592 | static struct sig_handlers |
592 | static struct sig_handlers |
593 | { |
593 | { |
594 | sig_watcher sw_term, sw_int; |
594 | ev::sig sw_term, sw_int; |
595 | |
595 | |
596 | /* |
596 | /* |
597 | * Catch a fatal signal and tidy up before quitting |
597 | * Catch a fatal signal and tidy up before quitting |
598 | */ |
598 | */ |
599 | void |
599 | void |
600 | sig_term (sig_watcher &w) |
600 | sig_term (ev::sig &w, int revents) |
601 | { |
601 | { |
602 | rxvt_emergency_cleanup (); |
602 | rxvt_emergency_cleanup (); |
603 | signal (w.signum, SIG_DFL); |
603 | w.stop (); |
604 | kill (getpid (), w.signum); |
604 | kill (getpid (), w.signum); |
605 | } |
605 | } |
606 | |
606 | |
607 | sig_handlers () |
607 | sig_handlers () |
608 | : sw_term (this, &sig_handlers::sig_term), |
608 | : sw_term (this, &sig_handlers::sig_term), |
… | |
… | |
615 | |
615 | |
616 | void |
616 | void |
617 | rxvt_init () |
617 | rxvt_init () |
618 | { |
618 | { |
619 | ptytty::init (); |
619 | ptytty::init (); |
|
|
620 | ev::ev_default_loop (0); |
620 | |
621 | |
621 | rxvt_environ = environ; |
622 | rxvt_environ = environ; |
622 | |
623 | |
623 | signal (SIGHUP, SIG_IGN); |
624 | signal (SIGHUP, SIG_IGN); |
624 | signal (SIGPIPE, SIG_IGN); |
625 | signal (SIGPIPE, SIG_IGN); |
625 | |
626 | |
626 | sig_handlers.sw_term.start (SIGTERM); |
627 | sig_handlers.sw_term.start (SIGTERM); ev::ev_unref (); |
627 | sig_handlers.sw_int.start (SIGINT); |
628 | sig_handlers.sw_int.start (SIGINT); ev::ev_unref (); |
628 | |
629 | |
629 | /* need to trap SIGURG for SVR4 (Unixware) rlogin */ |
630 | /* need to trap SIGURG for SVR4 (Unixware) rlogin */ |
630 | /* signal (SIGURG, SIG_DFL); */ |
631 | /* signal (SIGURG, SIG_DFL); */ |
631 | |
632 | |
632 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
633 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
… | |
… | |
1740 | int |
1741 | int |
1741 | rxvt_term::update_background () |
1742 | rxvt_term::update_background () |
1742 | { |
1743 | { |
1743 | bgPixmap.invalidate (); |
1744 | bgPixmap.invalidate (); |
1744 | |
1745 | |
1745 | /* no chance of real time refresh if we are blurring ! */ |
1746 | /* no chance of real time refresh if we are blurring! */ |
1746 | if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
1747 | if (bgPixmap.invalid_since + 0.5 < ev::now () && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
1747 | bgPixmap.render (); |
1748 | bgPixmap.render (); |
1748 | else |
1749 | else |
1749 | { |
1750 | { |
1750 | update_background_ev.stop (); |
1751 | update_background_ev.stop (); |
|
|
1752 | |
1751 | if (!bgPixmap.need_client_side_rendering()) |
1753 | if (!bgPixmap.need_client_side_rendering()) |
1752 | update_background_ev.start (NOW + .05); |
1754 | update_background_ev.start (.05); |
1753 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
1755 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
1754 | update_background_ev.start (NOW + .2); /* very slow !!! */ |
1756 | update_background_ev.start (.20); /* very slow !!! */ |
1755 | else |
1757 | else |
1756 | update_background_ev.start (NOW + .07); |
1758 | update_background_ev.start (.07); |
1757 | } |
1759 | } |
|
|
1760 | |
1758 | return 0; |
1761 | return 0; |
1759 | } |
1762 | } |
1760 | |
1763 | |
1761 | void |
1764 | void |
1762 | rxvt_term::update_background_cb (time_watcher &w) |
1765 | rxvt_term::update_background_cb (ev::timer &w, int revents) |
1763 | { |
1766 | { |
1764 | bgPixmap.render (); |
1767 | bgPixmap.render (); |
1765 | } |
1768 | } |
1766 | |
1769 | |
1767 | #endif /* HAVE_BG_PIXMAP */ |
1770 | #endif /* HAVE_BG_PIXMAP */ |