Subject: bug#68452: w32-use-native-image-API makes weird behavior

From: Eli Zaretskii <[email-masked]>
Date: Mon, 15 Jan 2024 16:53:21 +0200

> Date: Mon, 15 Jan 2024 22:17:37 +0800
> Cc: [email-masked]
> From: Jinsong Zhao <[email-masked]>
> 
> > Thanks.  I have no problems displaying the 2 PNG files with
> > w32-use-native-image-API set to a non-nil value.  So I don't know why
> > this doesn't work for you.  Are you able to display the files you sent
> > in your Emacs with w32-use-native-image-API set to its default non-nil
> > value?
> My problem is not that I can't display images, but that the same action 
> doesn't work the same way with either setting.
> 
> When w32-use-native-image-API is nil, image "1" can be displayed as soon 
> as the Enter key is pressed (before "(%2)" appears, see 11.png). 
> However, if w32-use-native-image-API is t, image 1 will not be 
> displayed, just an empty box (see 22.png).
> 
> Now we enter another expression. If w32-use-native-image-API is nil, 
> image "2" can be displayed immediately after pressing enter, and it will 
> not affect the display of the previous image "1", see 33.png. If 
> w32-use-native-image-API is t, instead of displaying an empty box, image 
> "2" is not displayed, but the first empty box is replaced by image "1", 
> see 44.png.

I see.  But in that case, this is something that involves imaxima and
what it does, and I'm not familiar with that.  The empty box means
Emacs cannot display the image for whatever reason -- it could be that
the image is invalid, or there's not enough memory, or something else.
Since when you press enter twice, you see the first image instead of
the second, this is something related with how imaxima outputs the
image and passes it to Emacs.  Sorry, I cannot help you more than that
since I don't know enough about imaxima and its interfaces.

So I suggest that you set w32-use-native-image-API to nil, and use
imaxima that way.