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

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.20 by root, Mon Dec 24 06:51:37 2007 UTC vs.
Revision 1.24 by ayin, Mon Jan 7 12:41:31 2008 UTC

96 h_scale = v_scale = 0; 96 h_scale = v_scale = 0;
97 h_align = v_align = 0; 97 h_align = v_align = 0;
98#endif 98#endif
99 flags = 0; 99 flags = 0;
100 pixmap = None; 100 pixmap = None;
101 valid_since = invalid_since = 0;
101} 102}
102 103
103void 104void
104bgPixmap_t::destroy () 105bgPixmap_t::destroy ()
105{ 106{
256 int x = 0, y = 0; 257 int x = 0, y = 0;
257 unsigned int w = 0, h = 0; 258 unsigned int w = 0, h = 0;
258 unsigned int n; 259 unsigned int n;
259 unsigned long new_flags = (flags & (~geometryFlags)); 260 unsigned long new_flags = (flags & (~geometryFlags));
260 char *p; 261 char *p;
261# define MAXLEN_GEOM 256 /* could be longer then regular geometry string */ 262# define MAXLEN_GEOM 256 /* could be longer than regular geometry string */
262 263
263 if (geom == NULL) 264 if (geom == NULL)
264 return false; 265 return false;
265 266
266 char str[MAXLEN_GEOM]; 267 char str[MAXLEN_GEOM];
273 if (n < MAXLEN_GEOM) 274 if (n < MAXLEN_GEOM)
274 { 275 {
275 char *ops; 276 char *ops;
276 new_flags |= geometrySet; 277 new_flags |= geometrySet;
277 278
278 strncpy (str, geom, n); 279 memcpy (str, geom, n);
279 str[n] = '\0'; 280 str[n] = '\0';
280 if (str[0] == ':') 281 if (str[0] == ':')
281 ops = &str[0]; 282 ops = &str[0];
282 else if (str[0] != 'x' && str[0] != 'X' && isalpha(str[0])) 283 else if (str[0] != 'x' && str[0] != 'X' && isalpha(str[0]))
283 ops = &str[0]; 284 ops = &str[0];
511 100, ASIMAGE_QUALITY_DEFAULT); 512 100, ASIMAGE_QUALITY_DEFAULT);
512 } 513 }
513 if (background == NULL) 514 if (background == NULL)
514 { 515 {
515 /* if tiling - pixmap has to be sized exactly as the image, 516 /* if tiling - pixmap has to be sized exactly as the image,
516 but there is no need to make it bigger then the window! */ 517 but there is no need to make it bigger than the window! */
517 if (h_scale == 0) 518 if (h_scale == 0)
518 new_pmap_width = min (result->width, target_width); 519 new_pmap_width = min (result->width, target_width);
519 if (v_scale == 0) 520 if (v_scale == 0)
520 new_pmap_height = min (result->height, target_height); 521 new_pmap_height = min (result->height, target_height);
521 /* we also need to tile our image in one or both directions */ 522 /* we also need to tile our image in one or both directions */
667 original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100); 668 original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100);
668 else 669 else
669 { 670 {
670 size_t len = f - file; 671 size_t len = f - file;
671 f = (char *)malloc (len + 1); 672 f = (char *)malloc (len + 1);
672 strncpy (f, file, len); 673 memcpy (f, file, len);
673 f[len] = '\0'; 674 f[len] = '\0';
674 original_asim = get_asimage (target->asimman, f, 0xFFFFFFFF, 100); 675 original_asim = get_asimage (target->asimman, f, 0xFFFFFFFF, 100);
675 free (f); 676 free (f);
676 } 677 }
677 return (original_asim != NULL); 678 return (original_asim != NULL);
900 XGrabServer (dpy); 901 XGrabServer (dpy);
901 XMapRaised (dpy, src); 902 XMapRaised (dpy, src);
902 XSync (dpy, False); 903 XSync (dpy, False);
903 904
904 /* XSync should get window where it's properly exposed, 905 /* XSync should get window where it's properly exposed,
905 * but to be on the safe side - let's check for the actuall event to arrive : */ 906 * but to be on the safe side - let's check for the actual event to arrive : */
906 while (XCheckWindowEvent (dpy, src, ExposureMask, &event)) 907 while (XCheckWindowEvent (dpy, src, ExposureMask, &event))
907 ++ev_count; 908 ++ev_count;
908 909
909 if (ev_count > 0); 910 if (ev_count > 0);
910 { 911 {
1237 pixmap = None; 1238 pixmap = None;
1238 } 1239 }
1239 } 1240 }
1240 1241
1241 apply (); 1242 apply ();
1243
1244 XSync (target->dpy, False);
1245 valid_since = ev::now ();
1242 1246
1243 TIMING_TEST_PRINT_RESULT (tp); 1247 TIMING_TEST_PRINT_RESULT (tp);
1244 1248
1245 return true; 1249 return true;
1246} 1250}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines