int ntargets = 0, nnames = 0;
char *target_names[2048];
Atom *target_atoms;
- Lisp_Object lval, original, tem, t1, t2;
+ Lisp_Object lval, original, targets_arg, tem, t1, t2;
Atom xaction;
Atom action_list[2048];
char *name_list[2048];
CHECK_LIST (targets);
original = targets;
+ targets_arg = targets;
for (; CONSP (targets); targets = XCDR (targets))
{
xaction, return_frame, action_list,
(const char **) &name_list, nnames,
!NILP (allow_current_frame), target_atoms,
- ntargets, original, !NILP (follow_tooltip));
+ ntargets, targets_arg, !NILP (follow_tooltip));
SAFE_FREE ();
return lval;
x_dnd_action_symbol = Qnil;
}
+/* Delete action descriptions from F after drag-and-drop. */
+static void
+x_dnd_delete_action_list (Lisp_Object frame)
+{
+ struct frame *f;
+
+ /* Delete those two properties, since some clients look at them and
+ not the action to decide whether or not the user should be
+ prompted to select an action. This can be called with FRAME no
+ longer alive (or its display dead). */
+
+ f = XFRAME (frame);
+
+ if (!FRAME_LIVE_P (f) || !FRAME_DISPLAY_INFO (f)->display)
+ return;
+
+ block_input ();
+ XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ FRAME_DISPLAY_INFO (f)->Xatom_XdndActionList);
+ XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ FRAME_DISPLAY_INFO (f)->Xatom_XdndActionDescription);
+ unblock_input ();
+}
+
/* This function is defined far away from the rest of the XDND code so
it can utilize `x_any_window_to_frame'. */
= xm_side_effect_from_action (FRAME_DISPLAY_INFO (f),
ask_action_list[0]);
+ record_unwind_protect (x_dnd_delete_action_list, frame);
+
ask_actions = NULL;
end = 0;
count = SPECPDL_INDEX ();
unbind_to (count, Qnil);
}
- else
- {
- /* Delete those two properties, since some clients look at them
- and not the action to decide whether or not the user should
- be prompted to select an action. */
-
- block_input ();
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndActionList);
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndActionDescription);
- unblock_input ();
- }
if (follow_tooltip)
{