emacs-diffs
[Top][All Lists]
Advanced

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

master ec025f22ef: Handle bad actual actions during DND


From: Po Lu
Subject: master ec025f22ef: Handle bad actual actions during DND
Date: Sun, 17 Apr 2022 09:25:36 -0400 (EDT)

branch: master
commit ec025f22ef9642aa6d1d8b4ced6820aeb708d7d7
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Handle bad actual actions during DND
    
    * src/xterm.c (x_dnd_begin_drag_and_drop): Behave correctly when
    the target gives us a bad atom.
---
 src/xterm.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index ab4dcc3841..4241b4d0d6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9844,10 +9844,18 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, 
Atom xaction,
   if (x_dnd_action != None)
     {
       block_input ();
+      x_catch_errors (FRAME_X_DISPLAY (f));
       atom_name = XGetAtomName (FRAME_X_DISPLAY (f),
                                x_dnd_action);
-      action = intern (atom_name);
-      XFree (atom_name);
+      x_uncatch_errors ();
+
+      if (atom_name)
+       {
+         action = intern (atom_name);
+         XFree (atom_name);
+       }
+      else
+       action = Qnil;
       unblock_input ();
 
       return action;



reply via email to

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