aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2011-06-20 22:49:12 +0200
committerJan Djärv2011-06-20 22:49:12 +0200
commitca5307394f6861fc825434c268e0a44adf8a3252 (patch)
tree409fcced16cdeac26e13dcd59579256c067d91b3
parent4cb3bfa09c6838a579fcf3dab9b7ea1135a2fb4b (diff)
downloademacs-ca5307394f6861fc825434c268e0a44adf8a3252.tar.gz
emacs-ca5307394f6861fc825434c268e0a44adf8a3252.zip
* x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): New functions that handle long-as-cons and long as number. (x-dnd-handle-xdnd): Call functions above. Fixes: debbugs:8899
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/x-dnd.el17
2 files changed, 22 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ceab0a14fcf..76339320b83 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12011-06-20 Jan Djärv <jan.h.d@swipnet.se>
2
3 * x-dnd.el (x-dnd-version-from-flags)
4 (x-dnd-more-than-3-from-flags): New functions that handle long-as-cons
5 and long as number (Bug#8899).
6 (x-dnd-handle-xdnd): Call functions above (Bug#8899).
7
12011-06-20 Stefan Monnier <monnier@iro.umontreal.ca> 82011-06-20 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * minibuffer.el (completion-metadata): Prepend the alist with `metadata'. 10 * minibuffer.el (completion-metadata): Prepend the alist with `metadata'.
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 1c6af1f45f2..04b759a8116 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -433,6 +433,18 @@ otherwise return the frame coordinates."
433(declare-function x-get-selection-internal "xselect.c" 433(declare-function x-get-selection-internal "xselect.c"
434 (selection-symbol target-type &optional time-stamp)) 434 (selection-symbol target-type &optional time-stamp))
435 435
436(defun x-dnd-version-from-flags (flags)
437 "Return the version byte from the 32 bit FLAGS in an XDndEnter message"
438 (if (consp flags) ;; Long as cons
439 (ash (car flags) -8)
440 (ash flags -24))) ;; Ordinary number
441
442(defun x-dnd-more-than-3-from-flags (flags)
443 "Return the nmore-than3 bit from the 32 bit FLAGS in an XDndEnter message"
444 (if (consp flags)
445 (logand (cdr flags) 1)
446 (logand flags 1)))
447
436(defun x-dnd-handle-xdnd (event frame window message _format data) 448(defun x-dnd-handle-xdnd (event frame window message _format data)
437 "Receive one XDND event (client message) and send the appropriate reply. 449 "Receive one XDND event (client message) and send the appropriate reply.
438EVENT is the client message. FRAME is where the mouse is now. 450EVENT is the client message. FRAME is where the mouse is now.
@@ -440,9 +452,10 @@ WINDOW is the window within FRAME where the mouse is now.
440FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." 452FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
441 (cond ((equal "XdndEnter" message) 453 (cond ((equal "XdndEnter" message)
442 (let* ((flags (aref data 1)) 454 (let* ((flags (aref data 1))
443 (version (and (consp flags) (ash (car flags) -8))) 455 (version (x-dnd-version-from-flags flags))
444 (more-than-3 (and (consp flags) (cdr flags))) 456 (more-than-3 (x-dnd-more-than-3-from-flags flags))
445 (dnd-source (aref data 0))) 457 (dnd-source (aref data 0)))
458 (message "%s %s" version more-than-3)
446 (if version ;; If flags is bad, version will be nil. 459 (if version ;; If flags is bad, version will be nil.
447 (x-dnd-save-state 460 (x-dnd-save-state
448 window nil nil 461 window nil nil