--- rxvt-unicode/src/init.C 2008/11/04 11:03:29 1.254 +++ rxvt-unicode/src/init.C 2009/04/26 01:51:20 1.257 @@ -394,17 +394,17 @@ select_visual (strtol (rs[Rs_depth], 0, 0)); #endif -#ifdef HAVE_AFTERIMAGE - set_application_name ((char*)rs[Rs_name]); - set_output_threshold (OUTPUT_LEVEL_WARNING); - asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); -#endif free (r_argv); for (int i = NUM_RESOURCES; i--; ) if (rs [i] == resval_undef) rs [i] = 0; +#ifdef HAVE_AFTERIMAGE + set_application_name ((char *)rs[Rs_name]); + set_output_threshold (OUTPUT_LEVEL_WARNING); +#endif + #if ENABLE_PERL if (!rs[Rs_perl_ext_1]) rs[Rs_perl_ext_1] = "default"; @@ -425,6 +425,7 @@ { if (!rs[Rs_title]) rs[Rs_title] = rxvt_basename (cmd_argv[0]); + if (!rs[Rs_iconName]) rs[Rs_iconName] = rs[Rs_title]; } @@ -432,6 +433,7 @@ { if (!rs[Rs_title]) rs[Rs_title] = rs[Rs_name]; + if (!rs[Rs_iconName]) rs[Rs_iconName] = rs[Rs_name]; } @@ -567,7 +569,7 @@ init_xlocale (); - scr_reset (); // initialize screen + scr_poweron (); // initialize screen #if 0 XSynchronize (dpy, True); @@ -1124,8 +1126,8 @@ old_width = szHint.width; old_height = szHint.height; - process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); - process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); + set_title (rs [Rs_title]); + set_icon_name (rs [Rs_iconName]); classHint.res_name = (char *)rs[Rs_name]; classHint.res_class = (char *)RESCLASS; @@ -1143,10 +1145,13 @@ * set up icon hint * rs [Rs_iconfile] is path to icon, asv has been created in init_resources */ - if (rs [Rs_iconfile] && asv) + + if (rs [Rs_iconfile]) { + init_asv (); + ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); - if (im) + if (asv && im) { int w = im->width; int h = im->height; @@ -1167,7 +1172,7 @@ destroy_asimage (&result); XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, - PropModeReplace, (const unsigned char*) buffer, 2 + w * h); + PropModeReplace, (const unsigned char*) buffer, 2 + w * h); free (buffer); } else