summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/doc-view.el1
-rw-r--r--src/dispextern.h4
-rw-r--r--src/image.c9
3 files changed, 14 insertions, 0 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index f7a7be96b3d..dbd93563a23 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -432,6 +432,7 @@ Typically \"page-%s.png\".")
(define-key map "P" 'doc-view-fit-page-to-window)
(define-key map "F" 'doc-view-fit-window-to-page) ;F = frame
;; Killing the buffer (and the process)
+ (define-key map (kbd "k") 'image-kill-buffer)
(define-key map (kbd "K") 'doc-view-kill-proc)
;; Slicing the image
(define-key map (kbd "c s") 'doc-view-set-slice)
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
# if !defined USE_CAIRO && defined HAVE_XRENDER
/* Picture versions of pixmap and mask for compositing. */
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 /* HAVE_X_WINDOWS */
#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)
# if !defined USE_CAIRO && defined HAVE_XRENDER
if (!img->picture)
return;
+
+ /* Store the original dimensions as we'll overwrite them later. */
+ img->original_width = img->width;
+ img->original_height = img->height;
# endif
/* Determine size. */
@@ -3029,6 +3033,11 @@ image_get_x_image (struct frame *f, struct image *img, bool mask_p)
if (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
return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
0, 0, img->width, img->height, ~0, ZPixmap);