1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00
Commit Graph

4 Commits

Author SHA1 Message Date
Po Lu
a4339190ec Fix PGTK DND after a source leaves without dropping anything
* lisp/pgtk-dnd.el (pgtk-dnd-clear-data-on-motion): New flag.
(pgtk-dnd-handle-gdk): Set flag upon drag-leave.  Clear state
upon drag-motion if it is set.
2022-07-23 15:00:34 +08:00
Po Lu
0ebad14f20 * lisp/pgtk-dnd.el (pgtk-dnd-use-offix-drop): Remove extra variable. 2022-06-29 16:00:09 +08:00
Po Lu
5cbe50a4fb Make DND from other GTK programs work on Wayland
* lisp/pgtk-dnd.el (pgtk-dnd-handle-gdk): Try to keep the
selection contents in extra-data during a motion event.
2022-06-23 13:58:38 +08:00
Po Lu
0b4db66a9d Allow dropping more data types on PGTK
* lisp/loadup.el (featurep): Load `pgtk-dnd'.
* lisp/pgtk-dnd.el: New file.
(pgtk-dnd-test-function, pgtk-dnd-types-alist)
(pgtk-dnd-known-types, pgtk-dnd-use-offix-drop)
(pgtk-dnd-current-state, pgtk-get-selection-internal)
(pgtk-register-dnd-targets, pgtk-dnd-empty-state)
(pgtk-dnd-init-frame, pgtk-dnd-get-state-cons-for-frame)
(pgtk-dnd-get-state-for-frame, pgtk-dnd-default-test-function)
(pgtk-dnd-current-type, pgtk-dnd-forget-drop)
(pgtk-dnd-maybe-call-test-function, pgtk-dnd-save-state)
(pgtk-dnd-handle-moz-url, pgtk-dnd-insert-utf8-text)
(pgtk-dnd-insert-utf16-text, pgtk-dnd-insert-ctext)
(pgtk-dnd-handle-uri-list, pgtk-dnd-handle-file-name)
(pgtk-dnd-choose-type, pgtk-dnd-drop-data)
(pgtk-dnd-handle-drag-n-drop-event, pgtk-update-drop-status)
(pgtk-drop-finish, pgtk-dnd-handle-gdk, pgtk-dnd): New variables
and functions and library.

* lisp/term/pgtk-win.el (special-event-map): Load
`drag-n-drop-event'.
(after-make-frame-functions): Register DND after make frame
functions.

* src/emacs.c (main): Stop calling empty init_pgtkterm function.

* src/pgtkselect.c (Fpgtk_register_dnd_targets, Fpgtk_drop_finish)
(Fpgtk_update_drop_status): New functions.
(syms_of_pgtkselect): Register new functions.
* src/pgtkterm.c (struct event_queue_t): Fix coding style of
definition.
(symbol_to_drag_action, drag_action_to_symbol)
(pgtk_update_drop_status, pgtk_finish_drop): New functions.
(drag_data_received): Delete function.
(pgtk_set_event_handler): Register for DND correctly.
(syms_of_pgtkterm): New defsyms for DND types.
(init_pgtkterm): Delete function.

* src/pgtkterm.h: Update prototypes, fix prototype coding style.
2022-06-23 13:58:38 +08:00