aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2022-04-17 21:23:35 +0800
committerPo Lu2022-04-17 21:25:25 +0800
commitec025f22ef9642aa6d1d8b4ced6820aeb708d7d7 (patch)
treea7de5dc343b6debfaaeb40701913d02d3312e014
parentb38c3fe8632ec0ee4f180dae2938959bd8b4c46e (diff)
downloademacs-ec025f22ef9642aa6d1d8b4ced6820aeb708d7d7.tar.gz
emacs-ec025f22ef9642aa6d1d8b4ced6820aeb708d7d7.zip
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.
-rw-r--r--src/xterm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c
index ab4dcc3841a..4241b4d0d6b 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,
9844 if (x_dnd_action != None) 9844 if (x_dnd_action != None)
9845 { 9845 {
9846 block_input (); 9846 block_input ();
9847 x_catch_errors (FRAME_X_DISPLAY (f));
9847 atom_name = XGetAtomName (FRAME_X_DISPLAY (f), 9848 atom_name = XGetAtomName (FRAME_X_DISPLAY (f),
9848 x_dnd_action); 9849 x_dnd_action);
9849 action = intern (atom_name); 9850 x_uncatch_errors ();
9850 XFree (atom_name); 9851
9852 if (atom_name)
9853 {
9854 action = intern (atom_name);
9855 XFree (atom_name);
9856 }
9857 else
9858 action = Qnil;
9851 unblock_input (); 9859 unblock_input ();
9852 9860
9853 return action; 9861 return action;