ntargets, False, target_atoms);
unblock_input ();
- x_set_dnd_targets (target_atoms, ntargets);
lval = x_dnd_begin_drag_and_drop (f, FRAME_DISPLAY_INFO (f)->last_user_time,
xaction, return_frame, action_list,
(const char **) &name_list, nnames,
- !NILP (allow_current_frame));
+ !NILP (allow_current_frame), target_atoms,
+ ntargets);
SAFE_FREE ();
return lval;
return true;
}
-void
+static void
x_set_dnd_targets (Atom *targets, int ntargets)
{
if (x_dnd_targets)
#endif /* USE_X_TOOLKIT || USE_GTK */
-static void
-x_clear_dnd_targets (void)
-{
- if (x_dnd_unwind_flag)
- x_set_dnd_targets (NULL, 0);
-}
-
/* This function is defined far away from the rest of the XDND code so
it can utilize `x_any_window_to_frame'. */
x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
Lisp_Object return_frame, Atom *ask_action_list,
const char **ask_action_names, size_t n_ask_actions,
- bool allow_current_frame)
+ bool allow_current_frame, Atom *target_atoms,
+ int ntargets)
{
#ifndef USE_GTK
XEvent next_event;
}
if (!FRAME_VISIBLE_P (f))
- {
- x_set_dnd_targets (NULL, 0);
- error ("Frame is invisible");
- }
+ error ("Frame must be visible");
XSETFRAME (frame, f);
local_value = assq_no_quit (QXdndSelection,
FRAME_TERMINAL (f)->Vselection_alist);
if (x_dnd_in_progress || x_dnd_waiting_for_finish)
- {
- x_set_dnd_targets (NULL, 0);
- error ("A drag-and-drop session is already in progress");
- }
+ error ("A drag-and-drop session is already in progress");
if (CONSP (local_value))
- {
- ref = SPECPDL_INDEX ();
-
- record_unwind_protect_void (x_clear_dnd_targets);
- x_dnd_unwind_flag = true;
- x_own_selection (QXdndSelection,
- Fnth (make_fixnum (1), local_value), frame);
- x_dnd_unwind_flag = false;
- unbind_to (ref, Qnil);
- }
+ x_own_selection (QXdndSelection,
+ Fnth (make_fixnum (1), local_value), frame);
else
- {
- x_set_dnd_targets (NULL, 0);
- error ("No local value for XdndSelection");
- }
+ error ("No local value for XdndSelection");
if (popup_activated ())
- {
- x_set_dnd_targets (NULL, 0);
- error ("Trying to drag-and-drop from within a menu-entry");
- }
+ error ("Trying to drag-and-drop from within a menu-entry");
+
+ x_set_dnd_targets (target_atoms, ntargets);
ltimestamp = x_timestamp_for_selection (FRAME_DISPLAY_INFO (f),
QXdndSelection);
extern Lisp_Object x_dnd_begin_drag_and_drop (struct frame *, Time, Atom,
Lisp_Object, Atom *, const char **,
- size_t, bool);
+ size_t, bool, Atom *, int);
extern void x_dnd_do_unsupported_drop (struct x_display_info *, Lisp_Object,
Lisp_Object, Lisp_Object, Window, int,
int, Time);
-extern void x_set_dnd_targets (Atom *, int);
extern int x_display_pixel_height (struct x_display_info *);
extern int x_display_pixel_width (struct x_display_info *);