ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.254 by root, Tue Nov 4 11:03:29 2008 UTC vs.
Revision 1.255 by root, Tue Nov 4 13:20:40 2008 UTC

392#if XFT 392#if XFT
393 if (rs[Rs_depth]) 393 if (rs[Rs_depth])
394 select_visual (strtol (rs[Rs_depth], 0, 0)); 394 select_visual (strtol (rs[Rs_depth], 0, 0));
395#endif 395#endif
396 396
397#ifdef HAVE_AFTERIMAGE
398 set_application_name ((char*)rs[Rs_name]);
399 set_output_threshold (OUTPUT_LEVEL_WARNING);
400 asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL);
401#endif
402 free (r_argv); 397 free (r_argv);
403 398
404 for (int i = NUM_RESOURCES; i--; ) 399 for (int i = NUM_RESOURCES; i--; )
405 if (rs [i] == resval_undef) 400 if (rs [i] == resval_undef)
406 rs [i] = 0; 401 rs [i] = 0;
402
403#ifdef HAVE_AFTERIMAGE
404 set_application_name ((char *)rs[Rs_name]);
405 set_output_threshold (OUTPUT_LEVEL_WARNING);
406#endif
407 407
408#if ENABLE_PERL 408#if ENABLE_PERL
409 if (!rs[Rs_perl_ext_1]) 409 if (!rs[Rs_perl_ext_1])
410 rs[Rs_perl_ext_1] = "default"; 410 rs[Rs_perl_ext_1] = "default";
411 411
423 */ 423 */
424 if (cmd_argv && cmd_argv[0]) 424 if (cmd_argv && cmd_argv[0])
425 { 425 {
426 if (!rs[Rs_title]) 426 if (!rs[Rs_title])
427 rs[Rs_title] = rxvt_basename (cmd_argv[0]); 427 rs[Rs_title] = rxvt_basename (cmd_argv[0]);
428
428 if (!rs[Rs_iconName]) 429 if (!rs[Rs_iconName])
429 rs[Rs_iconName] = rs[Rs_title]; 430 rs[Rs_iconName] = rs[Rs_title];
430 } 431 }
431 else 432 else
432 { 433 {
433 if (!rs[Rs_title]) 434 if (!rs[Rs_title])
434 rs[Rs_title] = rs[Rs_name]; 435 rs[Rs_title] = rs[Rs_name];
436
435 if (!rs[Rs_iconName]) 437 if (!rs[Rs_iconName])
436 rs[Rs_iconName] = rs[Rs_name]; 438 rs[Rs_iconName] = rs[Rs_name];
437 } 439 }
438 440
439 if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0) 441 if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0)
1141# ifdef HAVE_AFTERIMAGE 1143# ifdef HAVE_AFTERIMAGE
1142 /* 1144 /*
1143 * set up icon hint 1145 * set up icon hint
1144 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources 1146 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources
1145 */ 1147 */
1148
1146 if (rs [Rs_iconfile] && asv) 1149 if (rs [Rs_iconfile])
1147 { 1150 {
1151 init_asv ();
1152
1148 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); 1153 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL);
1149 if (im) 1154 if (asv && im)
1150 { 1155 {
1151 int w = im->width; 1156 int w = im->width;
1152 int h = im->height; 1157 int h = im->height;
1153 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long)); 1158 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long));
1154 ASImage *result = scale_asimage (asv, im, 1159 ASImage *result = scale_asimage (asv, im,
1165 for (unsigned int i = 0; i < w * h; ++i) 1170 for (unsigned int i = 0; i < w * h; ++i)
1166 buffer [i + 2] = asbuf [i]; 1171 buffer [i + 2] = asbuf [i];
1167 1172
1168 destroy_asimage (&result); 1173 destroy_asimage (&result);
1169 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, 1174 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1170 PropModeReplace, (const unsigned char*) buffer, 2 + w * h); 1175 PropModeReplace, (const unsigned char*) buffer, 2 + w * h);
1171 free (buffer); 1176 free (buffer);
1172 } 1177 }
1173 else 1178 else
1174 { 1179 {
1175 if (!buffer) 1180 if (!buffer)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines