mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-05 19:31:02 -08:00
Fix tooltip text properties showing up in dragged text
* lisp/mouse.el (mouse-drag-and-drop-region): Directly call x-show-tip and x-hide-tip instead of going through tooltip-show.
This commit is contained in:
parent
b1c6d5f2b7
commit
47dcf72dec
1 changed files with 28 additions and 8 deletions
|
|
@ -3097,12 +3097,28 @@ is copied instead of being cut."
|
||||||
(frame-pixel-width frame))
|
(frame-pixel-width frame))
|
||||||
(> (cdr location)
|
(> (cdr location)
|
||||||
(frame-pixel-height frame)))))
|
(frame-pixel-height frame)))))
|
||||||
(tooltip-hide)
|
(x-hide-tip)
|
||||||
(gui-set-selection 'XdndSelection value-selection)
|
(gui-set-selection 'XdndSelection value-selection)
|
||||||
(when (framep
|
(let ((drag-action-or-frame
|
||||||
(x-begin-drag '("UTF8_STRING" "STRING") 'XdndActionCopy
|
(x-begin-drag '("UTF8_STRING" "STRING")
|
||||||
(posn-window (event-end event)) t))
|
(if mouse-drag-and-drop-region-cut-when-buffers-differ
|
||||||
(throw 'drag-again nil))
|
'XdndActionMove
|
||||||
|
'XdndActionCopy)
|
||||||
|
(posn-window (event-end event)) t)))
|
||||||
|
(when (framep drag-action-or-frame)
|
||||||
|
(throw 'drag-again nil))
|
||||||
|
|
||||||
|
(when (eq drag-action-or-frame 'XdndActionMove)
|
||||||
|
;; Remove the dragged text from source buffer like
|
||||||
|
;; operation `cut'.
|
||||||
|
(dolist (overlay mouse-drag-and-drop-overlays)
|
||||||
|
(delete-region (overlay-start overlay)
|
||||||
|
(overlay-end overlay))))
|
||||||
|
|
||||||
|
(when (eq drag-action-or-frame 'XdndActionCopy)
|
||||||
|
;; Set back the dragged text as region on source buffer
|
||||||
|
;; like operation `copy'.
|
||||||
|
(activate-mark)))
|
||||||
(throw 'cross-program-drag nil))
|
(throw 'cross-program-drag nil))
|
||||||
|
|
||||||
(setq window-to-paste (posn-window (event-end event)))
|
(setq window-to-paste (posn-window (event-end event)))
|
||||||
|
|
@ -3161,8 +3177,12 @@ is copied instead of being cut."
|
||||||
|
|
||||||
;; Show a tooltip.
|
;; Show a tooltip.
|
||||||
(if mouse-drag-and-drop-region-show-tooltip
|
(if mouse-drag-and-drop-region-show-tooltip
|
||||||
(tooltip-show text-tooltip)
|
;; Don't use tooltip-show since it has side effects
|
||||||
(tooltip-hide))
|
;; which change the text properties, and
|
||||||
|
;; `text-tooltip' can potentially be the text which
|
||||||
|
;; will be pasted.
|
||||||
|
(x-show-tip text-tooltip)
|
||||||
|
(x-hide-tip))
|
||||||
|
|
||||||
;; Show cursor and highlight the original region.
|
;; Show cursor and highlight the original region.
|
||||||
(when mouse-drag-and-drop-region-show-cursor
|
(when mouse-drag-and-drop-region-show-cursor
|
||||||
|
|
@ -3183,7 +3203,7 @@ is copied instead of being cut."
|
||||||
(mouse-set-point event)))))))
|
(mouse-set-point event)))))))
|
||||||
|
|
||||||
;; Hide a tooltip.
|
;; Hide a tooltip.
|
||||||
(when mouse-drag-and-drop-region-show-tooltip (tooltip-hide))
|
(when mouse-drag-and-drop-region-show-tooltip (x-hide-tip))
|
||||||
|
|
||||||
;; Check if modifier was pressed on drop.
|
;; Check if modifier was pressed on drop.
|
||||||
(setq no-modifier-on-drop
|
(setq no-modifier-on-drop
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue