1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Fix two crashes upon startup

* src/image.c (image_create_bitmap_from_data)
(image_create_bitmap_from_file): Specify a Window or a Pixmap
describing the screen, not a back buffer drawable which may not exist.
Otherwise, Emacs crashes on startup when a bitmap icon is in use.
This commit is contained in:
Po Lu 2023-04-28 11:47:46 +08:00
parent 44ebd9cbd5
commit a40f181623

View File

@ -479,7 +479,8 @@ image_create_bitmap_from_data (struct frame *f, char *bits,
#ifdef HAVE_X_WINDOWS
Pixmap bitmap;
bitmap = XCreateBitmapFromData (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f),
bitmap = XCreateBitmapFromData (FRAME_X_DISPLAY (f),
dpyinfo->root_window,
bits, width, height);
if (! bitmap)
return -1;
@ -729,8 +730,10 @@ image_create_bitmap_from_file (struct frame *f, Lisp_Object file)
filename = SSDATA (found);
result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f),
filename, &width, &height, &bitmap, &xhot, &yhot);
result = XReadBitmapFile (FRAME_X_DISPLAY (f),
dpyinfo->root_window,
filename, &width, &height, &bitmap,
&xhot, &yhot);
if (result != BitmapSuccess)
return -1;