--- rxvt-unicode/src/main.C 2007/11/11 04:08:00 1.256 +++ rxvt-unicode/src/main.C 2007/11/26 10:08:36 1.265 @@ -183,19 +183,19 @@ pointer_ev (this, &rxvt_term::pointer_cb), #endif #ifdef USE_XIM - im_ev (this, &rxvt_term::im_cb), + im_ev (this, &rxvt_term::im_cb), #endif #ifndef NO_BELL - bell_ev (this, &rxvt_term::bell_cb), + bell_ev (this, &rxvt_term::bell_cb), #endif termwin_ev (this, &rxvt_term::x_cb), - vt_ev (this, &rxvt_term::x_cb), - child_ev (this, &rxvt_term::child_cb), + vt_ev (this, &rxvt_term::x_cb), + child_ev (this, &rxvt_term::child_cb), prepare_ev (this, &rxvt_term::prepare_cb), - flush_ev (this, &rxvt_term::flush_cb), + flush_ev (this, &rxvt_term::flush_cb), destroy_ev (this, &rxvt_term::destroy_cb), - pty_ev (this, &rxvt_term::pty_cb), - incr_ev (this, &rxvt_term::incr_cb) + pty_ev (this, &rxvt_term::pty_cb), + incr_ev (this, &rxvt_term::incr_cb) { cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; @@ -286,6 +286,9 @@ delete [] pix_colors_unfocused; #endif +#ifdef HAVE_BG_PIXMAP + bgPixmap.destroy (); +#endif displays.put (display); scr_release (); @@ -308,6 +311,9 @@ #ifdef KEYSYM_RESOURCE delete keyboard; #endif +#ifndef NO_RESOURCES + XrmDestroyDatabase (option_db); +#endif } // child has exited, usually destroys @@ -372,7 +378,7 @@ } void -rxvt_term::destroy_cb (ev::check &w, int revents) +rxvt_term::destroy_cb (ev::idle &w, int revents) { make_current (); @@ -617,15 +623,17 @@ rxvt_init () { ptytty::init (); - ev::ev_default_loop (0); + + if (!ev_default_loop (0)) + rxvt_fatal ("cannot initialise libev (bad value for LIBEV_METHODS?)\n"); rxvt_environ = environ; signal (SIGHUP, SIG_IGN); signal (SIGPIPE, SIG_IGN); - sig_handlers.sw_term.start (SIGTERM); ev::ev_unref (); - sig_handlers.sw_int.start (SIGINT); ev::ev_unref (); + sig_handlers.sw_term.start (SIGTERM); ev_unref (); + sig_handlers.sw_int.start (SIGINT); ev_unref (); /* need to trap SIGURG for SVR4 (Unixware) rlogin */ /* signal (SIGURG, SIG_DFL); */ @@ -973,14 +981,16 @@ i = atoi (color); if (i >= 8 && i <= 15) - { /* bright colors */ + { + /* bright colors */ i -= 8; pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; goto done; } if (i >= 0 && i <= 7) - { /* normal colors */ + { + /* normal colors */ pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; goto done; } @@ -995,15 +1005,13 @@ pix_colors_focused[idx] = xcol; - /* XSetWindowAttributes attr; */ - /* Cursor cursor; */ done: /*TODO: handle Color_BD, scrollbar background, etc. */ update_fade_color (idx); recolour_cursor (); scr_recolour (); -#endif /* XTERM_COLOR_CHANGE */ +#endif /* XTERM_COLOR_CHANGE */ } void @@ -1706,7 +1714,7 @@ XFree (preedit_attr); } -#endif /* USE_XIM */ +#endif /* USE_XIM */ void rxvt_term::get_window_origin (int &x, int &y) @@ -1738,6 +1746,14 @@ } #ifdef HAVE_BG_PIXMAP +# if TRACE_PIXMAPS +# undef update_background +int rxvt_term::trace_update_background (const char* file, int line) +{ + fprintf (stderr, "%s:%d:update_background()\n", file, line); + update_background (); +} +# endif int rxvt_term::update_background () {