--- rxvt-unicode/src/main.C 2006/01/19 09:47:15 1.189 +++ rxvt-unicode/src/main.C 2006/01/20 10:27:08 1.191 @@ -50,10 +50,13 @@ vector rxvt_term::termlist; +// used to tell global functions which terminal instance is "active" +rxvt_t rxvt_current_term; + static char curlocale[128], savelocale[128]; bool -rxvt_set_locale (const char *locale) +rxvt_set_locale (const char *locale) NOTHROW { if (!locale || !strncmp (locale, curlocale, 128)) return false; @@ -64,14 +67,14 @@ } void -rxvt_push_locale (const char *locale) +rxvt_push_locale (const char *locale) NOTHROW { strcpy (savelocale, curlocale); rxvt_set_locale (locale); } void -rxvt_pop_locale () +rxvt_pop_locale () NOTHROW { rxvt_set_locale (savelocale); } @@ -184,9 +187,6 @@ #ifdef KEYSYM_RESOURCE keyboard = new keyboard_manager; - - if (!keyboard) - rxvt_fatal ("out of memory, aborting.\n"); #endif } @@ -202,8 +202,6 @@ rxvt_term::~rxvt_term () { - HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); - termlist.erase (find (termlist.begin (), termlist.end(), this)); emergency_cleanup (); @@ -306,6 +304,9 @@ if (destroy_ev.active) return; + if (HOOK_INVOKE ((this, HOOK_DESTROY, DT_END))) + return; + #if ENABLE_OVERLAY scr_overlay_off (); #endif @@ -465,11 +466,6 @@ keyboard->register_done (); #endif -#ifdef HAVE_SCROLLBARS - if (OPTION (Opt_scrollBar)) - scrollBar.setIdle (); /* set existence for size calculations */ -#endif - #if ENABLE_PERL if (!rs[Rs_perl_ext_1]) rs[Rs_perl_ext_1] = "default"; @@ -483,6 +479,11 @@ } #endif +#ifdef HAVE_SCROLLBARS + if (OPTION (Opt_scrollBar)) + scrollBar.setIdle (); /* set existence for size calculations */ +#endif + pty = rxvt_new_ptytty (); create_windows (argc, argv); @@ -510,9 +511,6 @@ } #endif - XMapWindow (disp, vt); - XMapWindow (disp, parent[0]); - set_colorfgbg (); init_command (cmd_argv); @@ -526,6 +524,9 @@ HOOK_INVOKE ((this, HOOK_START, DT_END)); + XMapWindow (disp, vt); + XMapWindow (disp, parent[0]); + return true; } @@ -633,7 +634,7 @@ return p; } -void * +void * rxvt_realloc (void *ptr, size_t size) { void *p = realloc (ptr, size); @@ -1591,7 +1592,4 @@ } #endif /* USE_XIM */ -/*----------------------------------------------------------------------*/ -rxvt_t rxvt_current_term; - /*----------------------- end-of-file (C source) -----------------------*/