Commit graph

160 commits

Author SHA1 Message Date
Po Lu
4d6f40dfc9 * lisp/x-dnd.el (x-dnd-do-direct-save): Remove redundant stmts. 2025-02-14 17:56:38 +08:00
Po Lu
fa4260594f X11 drag-and-drop corrections
* lisp/x-dnd.el (x-dnd-handle-drag-n-drop-event): Take cdddr of
client-message, skipping the selection information.
(x-dnd-do-direct-save): Do not erase the local copy of a remote
file if it was not in fact copied on behalf of the recipient.
(x-dnd-handle-xds-drop): Return proper action.

* src/xterm.c (x_term_init): Remove unused variable on non-GTK
builds.
2025-02-12 15:51:39 +08:00
Stefan Kangas
bf97946d7d Merge branch 'scratch/no-purespace' into 'master' 2025-02-01 04:56:52 +01:00
Paul Eggert
4da38c6321 Update copyright year to 2025
Run "TZ=UTC0 admin/update-copyright".
2025-01-01 07:39:17 +00:00
Stefan Kangas
b0afe306b7 Don't call purecopy in dnd.el
* lisp/dnd.el (dnd-protocol-alist):
* lisp/pgtk-dnd.el (pgtk-dnd-types-alist, pgtk-dnd-known-types):
* lisp/x-dnd.el (x-dnd-types-alist, x-dnd-known-types):
Remove calls to purecopy.
2024-12-12 22:48:18 +01:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Po Lu
7c668eb75b Properly respond to drops observing the Motif protocol
* lisp/pgtk-dnd.el (pgtk-dnd-handle-file-name):

* lisp/x-dnd.el (x-dnd-handle-file-name): Correct order of
arguments to d-h-m-u.
2023-10-26 19:49:40 +08:00
Po Lu
11f44ec6dd Enable DND handlers to receive more than one URI at a time
* doc/lispref/frames.texi (Drag and Drop): Illustrate the effect
of the dnd-multiple-handler property and how convergent handlers
are reconciled.

* etc/NEWS (Lisp Changes in Emacs 30.1): Announce this change.

* lisp/dnd.el (dnd-protocol-alist): Bring doc string up to date.
(dnd-handle-one-url): Obsolete this function.
(dnd-handle-multiple-urls): New function.

* lisp/pgtk-dnd.el (pgtk-dnd-handle-uri-list)
(pgtk-dnd-handle-file-name):

* lisp/term/android-win.el (android-handle-dnd-event):

* lisp/term/haiku-win.el (haiku-drag-and-drop):

* lisp/term/ns-win.el (ns-drag-n-drop):

* lisp/term/w32-win.el (w32-handle-dropped-file):

* lisp/x-dnd.el (x-dnd-handle-uri-list, x-dnd-handle-file-name):
Reimplement in terms of `dnd-handle-multiple-uris'.

* lisp/term/pgtk-win.el (pgtk-drag-n-drop)
(pgtk-drag-n-drop-other-frame, pgtk-drag-n-drop-as-text): Efface
detritus that remained after the removal of the old PGTK drag
and drop implementation.

* test/lisp/dnd-tests.el (ert-x, dnd-tests-list-1)
(dnd-tests-list-2, dnd-tests-list-3, dnd-tests-list-4)
(dnd-tests-local-file-function, dnd-tests-remote-file-function)
(dnd-tests-http-scheme-function, dnd-tests-browse-url-handler)
(dnd-tests-receive-multiple-urls): New tests.
2023-10-26 11:38:18 +00:00
Eli Zaretskii
44c2befb4a ; Fix byte-compilation warnings in --without-x build
* lisp/x-dnd.el (mwheel):
* lisp/term/haiku-win.el (mwheel): Require.
* lisp/progmodes/prog-mode.el (treesit-node-at):
* lisp/dynamic-setting.el (reconsider-frame-font): Declare.
(Bug#63415)
2023-05-11 16:25:46 +03:00
Eli Zaretskii
15e06260ae * lisp/x-dnd.el (x-dnd-after-move-frame): Skip dead frames. (Bug#63312) 2023-05-06 14:16:36 +03:00
Eli Zaretskii
08cda286c3 Improve the documentation of the XDS support
* doc/lispref/frames.texi (Drag and Drop): Rephrase and rearrange
the documentation of XDS support.  Add indexing.  Document
'x-dnd-save-direct' and 'x-dnd-save-direct-immediately'.  Original
patch from Po Lu <luangruo@yahoo.com>.

* lisp/x-dnd.el (x-dnd-types-alist, x-dnd-test-function)
(x-dnd-default-test-function, x-dnd-direct-save-function): Doc
fixes.
(x-dnd-save-direct, x-dnd-save-direct-immediately): Rename the
second argument to FILENAME.  Doc fix.
2023-04-08 18:36:23 +03:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Stefan Kangas
f7ee6609ae ; Fix typos (prefer US spelling) 2022-11-18 13:06:55 +01:00
Po Lu
b6097fe279 Fix drag-and-drop bugs on Lucid build
Also, optimize Fx_translate_coordinates to avoid excessive calls
to _XReply.

* lisp/x-dnd.el (x-dnd-get-drop-rectangle): Return empty drop
rectangle if posn-area.
* src/xfns.c (Fx_translate_coordinates): Accept arg
`require_child'.  If not set, allow optimizations based on
cached position data.
* src/xselect.c (x_handle_dnd_message): Use
x_translate_coordinates.
* src/xterm.c (x_translate_coordinates): Export function.
(x_handle_translate_coordinates): New function.
(handle_one_xevent): Fix coding style.
* src/xterm.h: Update prototypes.
2022-10-25 19:51:08 +08:00
Po Lu
e185526d21 Fix XDS file name expansion
* lisp/x-dnd.el (x-dnd-handle-xds-drop): Expand file names
again.  That code was mistakenly removed.
2022-10-15 13:27:37 +08:00
Stefan Kangas
3d7d8ddc5a ; Fix typos 2022-08-08 14:23:29 +02:00
Po Lu
2bc6d82831 Handle modifiers during Haiku DND wheel movement
* lisp/term/haiku-win.el (haiku-dnd-modifier-mask)
(haiku-dnd-wheel-modifier-type): New functions.
(haiku-handle-drag-wheel): Use them.
* lisp/x-dnd.el (x-dnd-modifier-mask): Remove outdated comment.
* src/haikuselect.c (haiku_note_drag_wheel): Pass modifiers to
wheel function.
(syms_of_haikuselect): Update doc strings.
2022-07-26 05:42:42 +00:00
Po Lu
295efb6025 Throw errors in XDS handler directly
* lisp/x-dnd.el (x-dnd-xds-testing): New defvar.
(x-dnd-handle-direct-save): Signal errors directly if it is
true.
* test/lisp/x-dnd-tests.el (x-dnd-xds-testing): New defvar.
(x-dnd-tests-do-direct-save-internal): Bind it to t around
x-begin-drag.  (bug#56712)
2022-07-24 21:33:42 +08:00
Po Lu
928ea0fbf1 ; * lisp/x-dnd.el (x-dnd-init-frame): Ignore tip frames. 2022-07-24 10:43:52 +08:00
Po Lu
33602132ac Handle text scale and global text scale during DND wheel movement
* lisp/x-dnd.el (x-dnd-mwheel-scroll): Handle `text-scale' and
`global-text-scale' mwheel actions.
2022-07-23 14:19:03 +08:00
Po Lu
f173028d15 Fix handling hscroll during drag-and-drop
* lisp/x-dnd.el (x-dnd-hscroll-flags): Delete function.
(x-dnd-get-modifiers, x-dnd-wheel-modifier-type): New functions.
(x-dnd-mwheel-scroll): Use that to determine hscroll instead.
* src/window.c (set_window_hscroll): Mark window as needing
redisplay if the hscroll really changed.
2022-07-22 15:37:28 +08:00
Mattias Engdegård
e536fb0851 Use ash instead of lsh
* lisp/files.el (file-modes-number-to-symbolic):
* lisp/image/exif.el (exif--direct-ascii-value):
* lisp/term/haiku-win.el (defun):
* lisp/x-dnd.el (x-dnd-handle-xdnd, x-dnd-handle-motif):
`lsh` is slower and has confusing semantics; avoid.
2022-07-19 15:21:56 +02:00
Po Lu
bcbd06b4bb Make drag-and-drop wheel movement work locally too on X
This is provided by the XDND protocol, so it isn't fair for it
to not work with local drag-and-drop.

* lisp/x-dnd.el (x-dnd-note-wheel-movement): New function.  Set
it as the `x-dnd-wheel-function'.
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Clear new flags.
(x_dnd_note_self_wheel): New function.  Set some flags.
(x_dnd_process_quit, x_dnd_begin_drag_and_drop, handle_one_xevent)
(x_connection_closed, x_delete_terminal, mark_xterm): Handle and
set new wheel movement flags
(syms_of_xterm): New variable `x-dnd-wheel-function'.
2022-07-19 09:33:09 +08:00
Po Lu
356618ca6a Handle virtual modifiers in the DND scrolling code
* lisp/x-dnd.el (x-dnd-modifier-mask): Handle virtual modifiers.
* src/xfns.c (Fx_get_modifier_masks): New function.
(syms_of_xfns): Define new subr.
* src/xterm.c (x_get_keyboard_modifiers): New function.
* src/xterm.h: Update prototypes.
2022-07-18 09:20:05 +08:00
Po Lu
202c12a24b Improve handling of tilt scroll and flip options during DND
* lisp/x-dnd.el (x-dnd-mwheel-scroll): New function.
(x-dnd-handle-xdnd): Use that instead of abusing mwheel.el.
2022-07-17 20:14:13 +08:00
Po Lu
e2ccd358c9 Handle scrolling during XDND drag-and-drop
* lisp/x-dnd.el (x-dnd-get-object-rectangle): Handle cases where
`posn-x-y' is nil.
(x-dnd-modifier-mask, x-dnd-hscroll-flags, x-dnd-note-click):
New functions.
(x-dnd-click-count): New defvar.
(x-dnd-handle-xdnd): Handle button press events.

* src/xterm.c (x_dnd_send_position): Fix handling of mouse
rects.
2022-07-17 11:06:14 +08:00
Po Lu
af61bc7d0c Decrease network traffic with some XDND programs
* lisp/x-dnd.el (x-dnd-get-drop-width-height):
(x-dnd-get-drop-x-y): Remove functions.

(x-dnd-get-window-rectangle, x-dnd-intersect-rectangles)
(x-dnd-get-object-rectangle, x-dnd-get-drop-rectangle): New
functions.
(x-dnd-handle-xdnd): Generate mouse rectangles consisting of the
object (glyph) under point.
2022-07-16 18:56:30 +08:00
Po Lu
200938b95d Fix generated drag-and-drop mouse rectangles
* lisp/x-dnd.el (x-dnd-get-drop-width-height): Handle window
width and height correctly.  Remove unused parameter.
(x-dnd-after-move-frame): New function.
(move-frame-functions): Add new hook.
(x-dnd-compute-root-window-position): New function.
(x-dnd-get-drop-x-y): Use that instead of `left' and `top'
parameters, which include the title bar.
(x-dnd-handle-xdnd): Update accordingly.
* src/xfns.c (Fx_translate_coordinates): New function.
(syms_of_xfns): New defsym.
2022-07-15 16:19:52 +08:00
Po Lu
6230ed6d63 Fix announcements of XDND mouse rectangles
* lisp/x-dnd.el (x-dnd-handle-xdnd): Use correct meaning of "2",
which isn't well documented.
* src/xterm.c (handle_one_xevent): Likewise.  Also fix unpacking
of mouse rects.
2022-07-06 08:45:34 +08:00
Po Lu
6dfe332971 Allow immediately saving XDS drops
This fixes things with programs that have a very timeout, such
as Chromium, within which it isn't practical for the user to
confirm the default file name.

* lisp/x-dnd.el (x-dnd-direct-save-function): Add new choices to
defcustom.
(x-dnd-init-frame): Use fast protocol requests.
(x-dnd-save-direct-immediately): New function.
(x-dnd-handle-xds-drop): Fix nil values of selected file name.
2022-07-05 14:56:17 +08:00
Po Lu
83f059793a Improve support for remote files in XDS
* lisp/x-dnd.el (x-dnd-direct-save-function): Remove "local file
name" from documentation.
(x-dnd-save-direct): Handle remote file names normally.
(x-dnd-handle-xds-drop): Handle remote file names in URI.
2022-07-05 10:40:32 +08:00
Po Lu
4ef1e4daf5 Speed up receiving drops over slow connections
* lisp/x-dnd.el (x-dnd-debug-errors): New variable.
(x-dnd-handle-drag-n-drop-event): Bind
`x-fast-protocol-requests' to t if that is off.

* src/xfns.c (Fx_change_window_property):
(Fx_delete_window_property):
* src/xselect.c (Fx_send_client_message, x_send_client_event):
Don't sync to check for errors if fast protocol requests are
enabled.

* src/xterm.c (x_catch_errors_for_lisp, x_check_errors_for_lisp)
(x_uncatch_errors_for_lisp): New functions.
(syms_of_xterm): New variable `x-fast-protocol-requests'.
* src/xterm.h: Update prototypes.
2022-07-03 09:43:20 +08:00
Po Lu
2b1cf5aff4 Fix drag-and-drop from Chromium family browsers
* lisp/x-dnd.el (x-dnd-copy-types): New defcustom.
(x-dnd-default-test-function): Check if data type warrants using
`copy'.
(x-dnd-do-direct-save): Offer application/octet-stream as well.
2022-07-02 14:06:40 +08:00
Po Lu
eb6d74a26c Return the correct action from the Lisp side of drag-and-drop
* lisp/x-dnd.el (x-dnd-handle-drag-n-drop-event): Select
`window' when handling internal DND events.
(x-dnd-handle-unsupported-drop): Return an appropriate action.
* src/keyboard.c (kbd_buffer_get_event):
* src/termhooks.h (enum event_kind): Delete
`UNSUPPORTED_DROP_EVENT'.
* src/xterm.c (x_dnd_send_unsupported_drop): Set flags instead
of recording input event.
(x_clear_dnd_monitors): Rename to `x_clear_dnd_variables'.  Also
clear unsupported drop data.
(x_dnd_begin_drag_and_drop): Run unsupported drop function
inline (and safely), and use its return value if it returned a
symbol.
(syms_of_xterm): Update doc string of
`x-dnd-unsupported-drop-function'.

* src/xterm.h: Update declarations.
2022-07-02 09:06:36 +08:00
Po Lu
06cd24698e Expand file names read from XDS functions
* lisp/x-dnd.el (x-dnd-handle-xds-drop): Expand file names
before use.  Some GUI dialogs read un-expanded file names.
2022-07-01 16:32:37 +08:00
Po Lu
ea5f5f81dd Support receiving XDS drops correctly
* etc/NEWS: Announce new feature.  It is not yet documented.
* lisp/x-dnd.el (x-dnd-known-types): Add XdndDirectSave0.
(x-dnd-direct-save-function): New defcustom.
(x-dnd-xdnd-to-action): Add `direct-save'.
(x-dnd-maybe-call-test-function): If XDS is present, use `direct-save'.
(x-dnd-find-type): New function.
(x-dnd-handle-xdnd): Handle XDS position and drop messages.
(x-dnd-handle-direct-save): Don't use local-file-uri if nil.
(x-dnd-save-direct): New function.
(x-dnd-handle-octet-stream-for-drop):
(x-dnd-handle-xds-drop): New functions.
2022-07-01 16:18:50 +08:00
Po Lu
833767e53f Disable middle click selection emulation during XDS
* doc/lispref/frames.texi (Drag and Drop): Document new
variable.
* lisp/x-dnd.el (x-dnd-do-direct-save): Disable drop emulation
during XDS drag-and-drop.

* src/keyboard.c (kbd_buffer_get_event): Handle recorded value.
* src/xterm.c (x_dnd_do_unsupported_drop): Return if new
variable is nil.
(x_dnd_send_unsupported_drop): Record value of new variable in
events.
(x_dnd_begin_drag_and_drop): Handle recorded value.
(syms_of_xterm): New variable `x-dnd-use-unsupported-drop'.
2022-07-01 09:10:34 +08:00
Po Lu
ebd980bc7e Disable unrelated drag-and-drop protocols during XDS drop
* doc/lispref/frames.texi (Drag and Drop): Document variables
used to control drag-and-drop protocols.
* lisp/x-dnd.el (x-dnd-do-direct-save): Disable irrelevant DND
protocols.

* src/xterm.c (x_dnd_get_target_window_1):
(x_dnd_get_target_window):
(handle_one_xevent): Respect new variable.
(syms_of_xterm): New variable `x-dnd-disable-motif-protocol'.
2022-06-30 16:41:58 +08:00
Po Lu
25887d634f Improve compliance with the XDS and XDND protocols
* lisp/select.el (xselect-convert-to-text-uri-list): Return a
type of `text/uri-list' instead of STRING or C_STRING.

* lisp/x-dnd.el (x-dnd-xds-performed): New defvar.
(x-dnd-handle-direct-save): Set it to t and handle URIs with
hostnames correctly. Also return errors correctly.
(x-dnd-handle-octet-stream): New function.
(x-dnd-do-direct-save): Handle application/octet-stream, check
results.
2022-06-30 14:15:50 +08:00
Po Lu
e83919f721 Fix some bugs found while testing drag-and-drop
* lisp/x-dnd.el (x-dnd-get-drop-width-height):
(x-dnd-get-drop-x-y): Fix doc string.
(x-dnd-handle-xdnd): Don't set update rect if
`dnd-indicate-insertion-point'.  Bug found testing with "JX
Application Framework".
2022-06-29 21:16:32 +08:00
Po Lu
f70e852ea6 ; Fix build warnings
* lisp/x-dnd.el (x-begin-drag): Add missing declarations.
2022-06-29 20:16:44 +08:00
Po Lu
d07063f69f Implement starting X Direct Save (XDS) drops
* doc/lispref/frames.texi (Drag and Drop): Document new function
`dnd-direct-save'.
* etc/NEWS: Likewise.

* lisp/dnd.el (dnd-direct-save-remote-files): New defcustom.
(dnd-begin-file-drag): Implement defucstom.
(dnd-begin-drag-files): Add kill-emacs-hook after saving remote
file.
(dnd-direct-save): New function.
* lisp/x-dnd.el (x-dnd-known-types): Fix coding style.
(x-dnd-handle-drag-n-drop-event): Handle local value with
self-originating DND events.
(x-dnd-xds-current-file, x-dnd-xds-source-frame): New defvars.
(x-dnd-handle-direct-save, x-dnd-do-direct-save): New functions.

* src/xfns.c (Fx_begin_drag): Allow any atom to be used as a DND
action.
* src/xselect.c (symbol_to_x_atom): Make public.
* src/xterm.c (x_dnd_note_self_drop): Include selection local
value.
(x_ignore_errors_for_next_request): Don't assume x_error_message
is set.
* src/xterm.h: Update prototypes.
2022-06-29 20:14:41 +08:00
Po Lu
0e6516a1f0 Fix reported problem with drag-and-drop inside VirtualBox
* lisp/x-dnd.el (x-dnd-handle-old-kde, x-dnd-handle-offix)
(x-dnd-handle-motif): Select window before handling drop, like
on Xdnd.
(x-dnd-convert-to-offix, x-dnd-do-offix-drop)
(x-dnd-handle-unsupported-drop): Accept local selection data and
use that instead.

* src/keyboard.c (kbd_buffer_get_event): Call unsupported drop
function with local selection data as 8th arg.
* src/xselect.c (x_get_local_selection): Accept new arg
`local_value'.  All callers changed.
(Fx_get_local_selection): New function.
(syms_of_xselect): Update defsubrs.

* src/xterm.c (x_dnd_lose_ownership): New function.
(x_dnd_begin_drag_and_drop): Unless new variable is true, disown
XdndSelection after returning.  This supposedly makes
drag-and-drop from guest to host work in VirtualBox without
causing pointer motion to become choppy afterwards.
(syms_of_xterm): New variable `x_dnd_preserve_selection_data'
and update doc string of `x-dnd-unsupported-drop-function'.

* test/lisp/dnd-tests.el (dnd-tests-begin-text-drag)
(dnd-tests-begin-file-drag, dnd-tests-begin-drag-files): Set new
variable to nil during tests.
2022-06-29 10:24:14 +08:00
Po Lu
ec6f6d23eb Fix XDND from Firefox again
* lisp/x-dnd.el (x-dnd-handle-xdnd): Prevent nil from appearing
in format 32 list.
(x-dnd-handle-motif): Send reply if the user quit out of the
drop handler as well.
2022-06-19 12:22:12 +08:00
Po Lu
4ce2322894 Improve compatibility when receiving drops from early XDND programs
* lisp/x-dnd.el (x-dnd-handle-xdnd): Save version in state.
If version is less than 5, don't put action and success in
XdndFinished events.  If less than 2, always use `copy' as
the selected action.
2022-06-17 15:29:59 +08:00
Po Lu
61a312ba0c Update last event time during DND operations
* lisp/x-dnd.el (x-dnd-handle-xdnd, x-dnd-handle-motif): Set
last user time to provided timestamp.
* src/xfns.c (Fx_display_last_user_time): New function.
(syms_of_xfns): New defsubr.

* src/xterm.c (x_set_last_user_time_from_lisp): New function.
* src/xterm.h: Update prototypes.
2022-06-17 10:24:11 +08:00
Po Lu
c782d6de79 Fix Motif drag-and-drop timestamps
* lisp/x-dnd.el (x-dnd-handle-motif): Pass timestamp when
retrieving DND selection value.  Bug found on Solaris 2.6.
2022-06-16 15:52:36 +08:00
Po Lu
dcee64d4bf Fix defcustom in last change
* lisp/x-dnd.el (x-dnd-use-offix-drop): Fix defcustom.
2022-06-16 14:41:21 +08:00
Po Lu
e5dbe60e3c Improve handling of fallback drop protocols
* lisp/x-dnd.el (x-dnd-use-offix-drop): New value `files', which
means to only drop files using the OffiX protocol.  Make it the
default.
(x-dnd-handle-old-kde): Handle other data types correctly.
(x-dnd-offix-old-kde-to-name): New variable.
(x-dnd-offix-id-to-name): Fix typo in doc string.
(x-dnd-handle-unsupported-drop): Implement new value.
2022-06-16 14:33:30 +08:00