--- rxvt-unicode/src/init.C 2008/01/04 17:57:28 1.238 +++ rxvt-unicode/src/init.C 2008/01/19 13:00:07 1.239 @@ -36,6 +36,7 @@ #include "rxvt.h" /* NECESSARY */ #include "rxvtutil.h" #include "init.h" +#include "keyboard.h" #include @@ -550,6 +551,125 @@ } /*----------------------------------------------------------------------*/ +void +rxvt_term::init (int argc, const char *const *argv, stringvec *envv) +{ + this->envv = envv; + + SET_R (this); + set_locale (""); + set_environ (envv); // few things in X do not call setlocale :( + + init_vars (); + + init_secondary (); + + const char **cmd_argv = init_resources (argc, argv); + +#ifdef KEYSYM_RESOURCE + keyboard->register_done (); +#endif + +#ifdef HAVE_SCROLLBARS + if (option (Opt_scrollBar)) + scrollBar.setIdle (); /* set existence for size calculations */ +#endif + + pty = ptytty::create (); + + create_windows (argc, argv); + + init_xlocale (); + + scr_reset (); // initialize screen + +#if 0 + XSynchronize (dpy, True); +#endif + +#ifdef HAVE_SCROLLBARS + if (option (Opt_scrollBar)) + resize_scrollbar (); /* create and map scrollbar */ +#endif +#ifdef HAVE_BG_PIXMAP + { + bgPixmap.set_target (this); + bgPixmap.invalidate (); + +#ifdef ENABLE_TRANSPARENCY + if (option (Opt_transparent)) + { + bgPixmap.set_transparent (); + +#ifdef HAVE_AFTERIMAGE + if (rs [Rs_blurradius]) + bgPixmap.set_blur_radius (rs [Rs_blurradius]); +#endif + if (ISSET_PIXCOLOR (Color_tint)) + bgPixmap.set_tint (pix_colors_focused [Color_tint]); + + if (rs [Rs_shade]) + bgPixmap.set_shade (rs [Rs_shade]); + + bgPixmap.set_root_pixmap (); + XSelectInput (dpy, display->root, PropertyChangeMask); + rootwin_ev.start (display, display->root); + } +#endif + +#ifdef BG_IMAGE_FROM_FILE + if (rs[Rs_backgroundPixmap]) + { + const char *p = rs[Rs_backgroundPixmap]; + + if ((p = strchr (p, ';')) != 0) + { + p++; + bgPixmap.set_geometry (p); + } + else + bgPixmap.set_defaultGeometry (); + + if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) + if (!bgPixmap.window_position_sensitive ()) + update_background (); + } +#endif + } +#endif + +#if ENABLE_PERL + rootwin_ev.start (display, display->root); +#endif + + set_colorfgbg (); + + init_command (cmd_argv); + + free (cmd_argv); + + if (pty->pty >= 0) + pty_ev.start (pty->pty, ev::READ); + + HOOK_INVOKE ((this, HOOK_START, DT_END)); + +#if ENABLE_XEMBED + if (rs[Rs_embed]) + { + long info[2] = { 0, XEMBED_MAPPED }; + + XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], + 32, PropModeReplace, (unsigned char *)&info, 2); + } +#endif + + XMapWindow (dpy, vt); + XMapWindow (dpy, parent[0]); + + refresh_check (); +} + +/*----------------------------------------------------------------------*/ void rxvt_term::init_env () {