aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2020-12-15 09:23:37 -0800
committerGlenn Morris2020-12-15 09:23:37 -0800
commit6a2c13280c4fb2e154e34af6e3b91dd77592d7ba (patch)
tree1cbd72ffb8f7e38d22c7ec82bd85f0a20cd4bdc8 /src
parentf3e21483106cb3ff64adcf21d30c8327a23a3401 (diff)
parent62a6934af9c110c28fc1f69f4bb1b79ce9d0c43d (diff)
downloademacs-6a2c13280c4fb2e154e34af6e3b91dd77592d7ba.tar.gz
emacs-6a2c13280c4fb2e154e34af6e3b91dd77592d7ba.zip
Merge from origin/emacs-27
62a6934af9 Fix crash when using XRender and restoring image from X (b... de032d41c6 Bind k to image-kill-buffer in doc-view-mode-map.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h4
-rw-r--r--src/image.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index da51772b37a..c76822ff390 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3040,6 +3040,10 @@ struct image
3040# if !defined USE_CAIRO && defined HAVE_XRENDER 3040# if !defined USE_CAIRO && defined HAVE_XRENDER
3041 /* Picture versions of pixmap and mask for compositing. */ 3041 /* Picture versions of pixmap and mask for compositing. */
3042 Picture picture, mask_picture; 3042 Picture picture, mask_picture;
3043
3044 /* We need to store the original image dimensions in case we have to
3045 call XGetImage. */
3046 int original_width, original_height;
3043# endif 3047# endif
3044#endif /* HAVE_X_WINDOWS */ 3048#endif /* HAVE_X_WINDOWS */
3045#ifdef HAVE_NTGUI 3049#ifdef HAVE_NTGUI
diff --git a/src/image.c b/src/image.c
index a3301ad2dda..dc06e9ce208 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2170,6 +2170,10 @@ image_set_transform (struct frame *f, struct image *img)
2170# if !defined USE_CAIRO && defined HAVE_XRENDER 2170# if !defined USE_CAIRO && defined HAVE_XRENDER
2171 if (!img->picture) 2171 if (!img->picture)
2172 return; 2172 return;
2173
2174 /* Store the original dimensions as we'll overwrite them later. */
2175 img->original_width = img->width;
2176 img->original_height = img->height;
2173# endif 2177# endif
2174 2178
2175 /* Determine size. */ 2179 /* Determine size. */
@@ -3029,6 +3033,11 @@ image_get_x_image (struct frame *f, struct image *img, bool mask_p)
3029 3033
3030 if (ximg_in_img) 3034 if (ximg_in_img)
3031 return ximg_in_img; 3035 return ximg_in_img;
3036#ifdef HAVE_XRENDER
3037 else if (img->picture)
3038 return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
3039 0, 0, img->original_width, img->original_height, ~0, ZPixmap);
3040#endif
3032 else 3041 else
3033 return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask, 3042 return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
3034 0, 0, img->width, img->height, ~0, ZPixmap); 3043 0, 0, img->width, img->height, ~0, ZPixmap);