@@ -412,19 +412,13 @@ FRAME is the frame and W is the window where the drop happened.
412
412
If W is a window, return its absolute coordinates,
413
413
otherwise return the frame coordinates."
414
414
(let* ((frame-left (frame-parameter frame 'left ))
415
- ; ; If the frame is outside the display, frame-left looks like
416
- ; ; '(0 -16). Extract the -16.
417
- (frame-real-left (if (consp frame-left) (car (cdr frame-left))
418
- frame-left))
419
- (frame-top (frame-parameter frame 'top ))
420
- (frame-real-top (if (consp frame-top) (car (cdr frame-top))
421
- frame-top)))
415
+ (frame-top (frame-parameter frame 'top )))
422
416
(if (windowp w)
423
417
(let ((edges (window-inside-pixel-edges w)))
424
418
(cons
425
- (+ frame-real- left (nth 0 edges))
426
- (+ frame-real- top (nth 1 edges))))
427
- (cons frame-real- left frame-real -top))))
419
+ (+ frame-left (nth 0 edges))
420
+ (+ frame-top (nth 1 edges))))
421
+ (cons frame-left frame-top))))
428
422
429
423
(declare-function x-get-atom-name " xselect.c" (value &optional frame))
430
424
(declare-function x-send-client-message " xselect.c"
@@ -434,15 +428,11 @@ otherwise return the frame coordinates."
434
428
435
429
(defun x-dnd-version-from-flags (flags )
436
430
" Return the version byte from the 32 bit FLAGS in an XDndEnter message."
437
- (if (consp flags) ; ; Long as cons
438
- (ash (car flags) -8 )
439
- (ash flags -24 ))) ; ; Ordinary number
431
+ (ash flags -24 ))
440
432
441
433
(defun x-dnd-more-than-3-from-flags (flags )
442
434
" Return the nmore-than3 bit from the 32 bit FLAGS in an XDndEnter message."
443
- (if (consp flags)
444
- (logand (cdr flags) 1 )
445
- (logand flags 1 )))
435
+ (logand flags 1 ))
446
436
447
437
(defun x-dnd-handle-xdnd (event frame window message _format data )
448
438
" Receive one XDND event (client message) and send the appropriate reply.
@@ -454,7 +444,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
454
444
(version (x-dnd-version-from-flags flags))
455
445
(more-than-3 (x-dnd-more-than-3-from-flags flags))
456
446
(dnd-source (aref data 0 )))
457
- (message " %s %s " version more-than-3)
447
+ (message " %s %s " version more-than-3)
458
448
(if version ; ; If flags is bad, version will be nil.
459
449
(x-dnd-save-state
460
450
window nil nil
@@ -545,30 +535,25 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
545
535
546
536
((eq size 4 )
547
537
(if (eq byteorder ?l )
548
- (cons ( + (ash (aref data (+ 3 offset)) 8 )
549
- (aref data (+ 2 offset)))
550
- ( + (ash (aref data (1+ offset)) 8 )
551
- (aref data offset) ))
552
- (cons ( + (ash (aref data offset) 8 )
553
- (aref data (1+ offset)) )
554
- ( + (ash (aref data (+ 2 offset)) 8 )
555
- (aref data (+ 3 offset) )))))))
538
+ (+ (ash (aref data (+ 3 offset)) 24 )
539
+ ( ash (aref data (+ 2 offset)) 16 )
540
+ (ash (aref data (1+ offset)) 8 )
541
+ (aref data offset))
542
+ (+ (ash (aref data offset) 24 )
543
+ (aref data (1+ offset) 16 )
544
+ (ash (aref data (+ 2 offset)) 8 )
545
+ (aref data (+ 3 offset)))))))
556
546
557
547
(defun x-dnd-motif-value-to-list (value size byteorder )
558
548
(let ((bytes (cond ((eq size 2 )
559
549
(list (logand (ash value -8 ) ?\xff )
560
550
(logand value ?\xff )))
561
551
562
552
((eq size 4 )
563
- (if (consp value)
564
- (list (logand (ash (car value) -8 ) ?\xff )
565
- (logand (car value) ?\xff )
566
- (logand (ash (cdr value) -8 ) ?\xff )
567
- (logand (cdr value) ?\xff ))
568
- (list (logand (ash value -24 ) ?\xff )
569
- (logand (ash value -16 ) ?\xff )
570
- (logand (ash value -8 ) ?\xff )
571
- (logand value ?\xff )))))))
553
+ (list (logand (ash value -24 ) ?\xff )
554
+ (logand (ash value -16 ) ?\xff )
555
+ (logand (ash value -8 ) ?\xff )
556
+ (logand value ?\xff ))))))
572
557
(if (eq byteorder ?l )
573
558
(reverse bytes)
574
559
bytes)))
0 commit comments