text that was dragged if this function returns @code{XdndActionMove}.
@end defun
+@cindex drag and drop protocols, X
+
+ On X Windows, several different drag-and-drop protocols are
+supported by @code{x-begin-drag}. When dragging content that is known
+to not be supported by a specific drag-and-drop protocol, it might be
+desirable to turn that protocol off, by changing the values of the
+following variables:
+
+@defvar x-dnd-disable-motif-protocol
+When this is non-@code{nil}, the Motif drag and drop protocols are
+disabled, and dropping onto programs that only understand them will
+not work.
+@end defvar
+
+@defvar x-dnd-use-offix-drop
+When this is @code{nil}, the OffiX (old KDE) drag and drop protocol is
+disabled. When this is the symbol @code{files}, the OffiX protocol
+will only be used if @code{"FILE_NAME"} is one of the targets given to
+@code{x-begin-drag}. Any other value means to use the OffiX protocol
+to drop all supported content.
+@end defvar
+
@node Color Names
@section Color Names
(defvar x-dnd-xds-performed nil
"Whether or not the drop target made a request for `XdndDirectSave0'.")
+(defvar x-dnd-disable-motif-protocol)
+
(defun x-dnd-handle-direct-save (_selection _type _value)
"Handle a selection request for `XdndDirectSave'."
(setq x-dnd-xds-performed t)
(x-dnd-xds-current-file nil)
(x-dnd-xds-source-frame frame)
(x-dnd-xds-performed nil)
+ ;; The XDS protocol is built on top of XDND, and cannot
+ ;; possibly work with Motif or OffiX programs.
+ (x-dnd-disable-motif-protocol t)
+ (x-dnd-use-offix-drop nil)
(prop-deleted nil)
encoded-name)
(unwind-protect
root_x and root_y are. */
*motif_out = XM_DRAG_STYLE_NONE;
+
for (tem = x_dnd_toplevels; tem; tem = tem->next)
{
if (!tem->mapped_p || tem->wm_state != NormalState)
if (chosen)
{
- *motif_out = chosen->xm_protocol_style;
+ *motif_out = (x_dnd_disable_motif_protocol
+ ? XM_DRAG_STYLE_NONE
+ : chosen->xm_protocol_style);
return chosen->window;
}
else
|| proto != -1 || motif != XM_DRAG_STYLE_NONE)
{
*proto_out = proto;
- *motif_out = motif;
+ *motif_out = (x_dnd_disable_motif_protocol
+ ? XM_DRAG_STYLE_NONE : motif);
*toplevel_out = child_return;
x_uncatch_errors ();
if (!xm_read_drag_receiver_info (dpyinfo, x_dnd_last_seen_window,
&drag_receiver_info)
+ && !x_dnd_disable_motif_protocol
&& drag_receiver_info.protocol_style != XM_DRAG_STYLE_NONE
&& (x_dnd_allow_current_frame
|| x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)))
if (!xm_read_drag_receiver_info (dpyinfo, x_dnd_last_seen_window,
&drag_receiver_info)
+ && !x_dnd_disable_motif_protocol
&& drag_receiver_info.protocol_style != XM_DRAG_STYLE_NONE
&& (x_dnd_allow_current_frame
|| x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)))
drag-and-drop operation, which is useful when writing tests for
drag-and-drop code. */);
x_dnd_preserve_selection_data = false;
+
+ DEFVAR_BOOL ("x-dnd-disable-motif-protocol", x_dnd_disable_motif_protocol,
+ doc: /* Disable the Motif drag-and-drop protocols.
+When non-nil, `x-begin-drag' will not drop onto any window that only
+supports the Motif drag-and-drop protocols. */);
+ x_dnd_disable_motif_protocol = false;
}