]> code.delx.au - gnu-emacs/commitdiff
* x-dnd.el (x-dnd-handle-xdnd): Handle the case where the flags
authorJan Djärv <jan.h.d@swipnet.se>
Sat, 5 Feb 2005 16:53:22 +0000 (16:53 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Sat, 5 Feb 2005 16:53:22 +0000 (16:53 +0000)
isn't a cons (i.e. the version is 0).

lisp/ChangeLog
lisp/x-dnd.el

index 491c3ce96dd93f87266d9b60e73cb985475111ff..e5a5c004148664a591f25d409c4ec9f0f357b659 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-05  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * x-dnd.el (x-dnd-handle-xdnd): Handle the case where the flags
+       isn't a cons (i.e. the version is 0).
+
 2005-02-05  Eli Zaretskii  <eliz@gnu.org>
 
        * help.el (help-for-help): Doc fix.
index f2b081fdcc5b9a8b37367545a2de6ac572d94881..a540c1b7af38b280ea0468bd3a6f99c67b01c9df 100644 (file)
@@ -557,18 +557,20 @@ EVENT is the client message.  FRAME is where the mouse is now.
 WINDOW is the window within FRAME where the mouse is now.
 FORMAT is 32 (not used).  MESSAGE is the data part of an XClientMessageEvent."
   (cond ((equal "XdndEnter" message)
-        (let ((version (ash (car (aref data 1)) -8))
-              (more-than-3 (cdr (aref data 1)))
-              (dnd-source (aref data 0)))
-          (x-dnd-save-state 
-           window nil nil
-           (if (> more-than-3 0)
-               (x-window-property "XdndTypeList"
-                                  frame "AnyPropertyType"
-                                  dnd-source nil t)
-             (vector (x-get-atom-name (aref data 2))
-                     (x-get-atom-name (aref data 3))
-                     (x-get-atom-name (aref data 4)))))))
+        (let* ((flags (aref data 1))
+               (version (and (consp flags) (ash (car flags) -8)))
+               (more-than-3 (and (consp flags) (cdr flags)))
+               (dnd-source (aref data 0)))
+          (if version  ;; If flags is bad, version will be nil.
+              (x-dnd-save-state
+               window nil nil
+               (if (> more-than-3 0)
+                   (x-window-property "XdndTypeList"
+                                      frame "AnyPropertyType"
+                                      dnd-source nil t)
+                 (vector (x-get-atom-name (aref data 2))
+                         (x-get-atom-name (aref data 3))
+                         (x-get-atom-name (aref data 4))))))))
 
        ((equal "XdndPosition" message)
         (let* ((x (car (aref data 2)))