Subject: bug#63312: 29.0.90; set-frame-parameter sometimes called with dead frame when quitting ediff

From: Eli Zaretskii <[email-masked]>
Date: Sat, 06 May 2023 13:34:41 +0300

> Date: Sat, 6 May 2023 12:10:33 +0200
> Cc: [email-masked]
> From: Tobias Bading <[email-masked]>
> 
> > Does the patch below give good results?
> >
> > diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
> > index 9286a18..acfbbed 100644
> > --- a/lisp/x-dnd.el
> > +++ b/lisp/x-dnd.el
> > @@ -609,8 +609,9 @@ x-dnd-init-xdnd-for-frame
> >  (defun x-dnd-after-move-frame (frame)
> >    "Handle FRAME moving to a different position.
> >  Clear any cached root window position."
> > -  (set-frame-parameter frame 'dnd-root-window-position
> > -                       nil))
> > +  (and (frame-live-p frame)
> > +       (set-frame-parameter frame 'dnd-root-window-position
> > +                            nil)))
> >
> >  (add-hook 'move-frame-functions #'x-dnd-after-move-frame)
> 
> It probably would, because for testing purposes I already patched
> handle-move-frame like this:

Not really, because there could be other functions on the hook
variable, which do deal well with a dead frame.

Po Lu, any objections to installing my proposed change?