mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-05 03:39:38 +00:00
Fix crash when using XRender and restoring image from X (bug#44930)
* src/dispextern.h (struct image): Add original dimension elements. * src/image.c (image_set_transform): Store the original dimensions. (image_get_x_image): If we're using transforms use the original dimensions with XGetImage.
This commit is contained in:
parent
de032d41c6
commit
62a6934af9
2 changed files with 13 additions and 0 deletions
|
@ -3047,6 +3047,10 @@ struct image
|
||||||
# if !defined USE_CAIRO && defined HAVE_XRENDER
|
# if !defined USE_CAIRO && defined HAVE_XRENDER
|
||||||
/* Picture versions of pixmap and mask for compositing. */
|
/* Picture versions of pixmap and mask for compositing. */
|
||||||
Picture picture, mask_picture;
|
Picture picture, mask_picture;
|
||||||
|
|
||||||
|
/* We need to store the original image dimensions in case we have to
|
||||||
|
call XGetImage. */
|
||||||
|
int original_width, original_height;
|
||||||
# endif
|
# endif
|
||||||
#endif /* HAVE_X_WINDOWS */
|
#endif /* HAVE_X_WINDOWS */
|
||||||
#ifdef HAVE_NTGUI
|
#ifdef HAVE_NTGUI
|
||||||
|
|
|
@ -2103,6 +2103,10 @@ image_set_transform (struct frame *f, struct image *img)
|
||||||
# if !defined USE_CAIRO && defined HAVE_XRENDER
|
# if !defined USE_CAIRO && defined HAVE_XRENDER
|
||||||
if (!img->picture)
|
if (!img->picture)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Store the original dimensions as we'll overwrite them later. */
|
||||||
|
img->original_width = img->width;
|
||||||
|
img->original_height = img->height;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Determine size. */
|
/* Determine size. */
|
||||||
|
@ -2930,6 +2934,11 @@ image_get_x_image (struct frame *f, struct image *img, bool mask_p)
|
||||||
|
|
||||||
if (ximg_in_img)
|
if (ximg_in_img)
|
||||||
return ximg_in_img;
|
return ximg_in_img;
|
||||||
|
#ifdef HAVE_XRENDER
|
||||||
|
else if (img->picture)
|
||||||
|
return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
|
||||||
|
0, 0, img->original_width, img->original_height, ~0, ZPixmap);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
|
return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
|
||||||
0, 0, img->width, img->height, ~0, ZPixmap);
|
0, 0, img->width, img->height, ~0, ZPixmap);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue