bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45277: DND errors


From: Juri Linkov
Subject: bug#45277: DND errors
Date: Mon, 21 Dec 2020 10:59:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

retitle 45277 DND errors
tags 45277 patch
quit

> Here's a test case for DND errors:
>
> Eval:
> (modify-frame-parameters nil '((undecorated . t)))
> (toggle-frame-maximized)
>
> (frame-parameter nil 'left)
> => (+ -1)
>
> Since it's not a number, x-dnd-handle-xdnd signals the error:
>
>   Bad data in VALUES, must be number, cons or string

I found that semantic-displayer-point-position checks for such syntax
and copied the same code to x-dnd-get-drop-x-y:

diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 1d49f46253..5af5490360 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -411,8 +411,10 @@ x-dnd-get-drop-x-y
 FRAME is the frame and W is the window where the drop happened.
 If W is a window, return its absolute coordinates,
 otherwise return the frame coordinates."
-  (let* ((frame-left (frame-parameter frame 'left))
-        (frame-top (frame-parameter frame 'top)))
+  (let* ((frame-left (or (car-safe (cdr-safe (frame-parameter frame 'left)))
+                        (frame-parameter frame 'left)))
+        (frame-top (or (car-safe (cdr-safe (frame-parameter frame 'top)))
+                       (frame-parameter frame 'top))))
     (if (windowp w)
        (let ((edges (window-inside-pixel-edges w)))
          (cons





reply via email to

[Prev in Thread] Current Thread [Next in Thread]