emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 a40f1816237: Fix two crashes upon startup


From: Po Lu
Subject: emacs-29 a40f1816237: Fix two crashes upon startup
Date: Thu, 27 Apr 2023 23:48:36 -0400 (EDT)

branch: emacs-29
commit a40f18162377d2f9a78d7443fd0f8106c8c28c3d
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/image.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/image.c b/src/image.c
index e78c0abb0db..8ee802a9d62 100644
--- a/src/image.c
+++ b/src/image.c
@@ -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;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]