From unknown Sat Aug 16 19:14:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18303: Drag and Drop fails when Emacs window/frame is above top Resent-From: Paulie Pena IV Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Aug 2014 15:46:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18303@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140854954932740 (code B ref -1); Wed, 20 Aug 2014 15:46:04 +0000 Received: (at submit) by debbugs.gnu.org; 20 Aug 2014 15:45:49 +0000 Received: from localhost ([127.0.0.1]:48329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XK856-0008Vz-D1 for submit@debbugs.gnu.org; Wed, 20 Aug 2014 11:45:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51846) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XK5LU-0004Bo-FV for submit@debbugs.gnu.org; Wed, 20 Aug 2014 08:50:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK5LO-00072S-E8 for submit@debbugs.gnu.org; Wed, 20 Aug 2014 08:50:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5LO-00072E-Aw for submit@debbugs.gnu.org; Wed, 20 Aug 2014 08:50:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5LN-0006Du-Ds for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 08:50:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK5LM-0006z7-K6 for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 08:50:25 -0400 Received: from mail-yk0-x22c.google.com ([2607:f8b0:4002:c07::22c]:35642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5LM-0006xX-Fk for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 08:50:24 -0400 Received: by mail-yk0-f172.google.com with SMTP id 10so6570132ykt.3 for ; Wed, 20 Aug 2014 05:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=E5COYmGifx23A2XoVflsxiklcHC3xhrO4N5In7dXYqI=; b=xbWDVtYAA6gOSzGLyhgzKV0rSXRbfpTzhs4Tr4maj6JbLJamg7HEMOZaRO93jpMr3e dk0m7ltPZ+6cPw84QRDkpUzkt/Z6AFKiGm9UtSX1CCukB3mjc7ULZAIoRoCA/6RdVMvR 1nt6EuE4GQR3oMfAM8ytWYtqEMlmP3Q1G8EAyLur+4w2UjXJEryxFMzK9mEdZR5sRA4q /DXAmOQ0XM38pwl67HIw9zeuRTfMqzeA4rkHU6v0ORJ0CNTFKIddpyc8N7JtXV/pZ94S HjQX31+PJnohWcMLv9QhPOU8l6ESJpJtFpW+aHdyEKeN4/OSS2JRoNfJOcYKQsVy59hp gshw== X-Received: by 10.236.102.70 with SMTP id c46mr233666yhg.194.1408539023315; Wed, 20 Aug 2014 05:50:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.100.65 with HTTP; Wed, 20 Aug 2014 05:50:03 -0700 (PDT) From: Paulie Pena IV Date: Wed, 20 Aug 2014 08:50:03 -0400 Message-ID: Content-Type: multipart/alternative; boundary=20cf301af45323189505010f0cce X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Mailman-Approved-At: Wed, 20 Aug 2014 11:45:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) --20cf301af45323189505010f0cce Content-Type: text/plain; charset=UTF-8 If my Emacs window is above the top of my screen (which is how I usually have it since I don't care about the title bar, etc.), I cannot drag a file onto the top part of the Emacs window/frame. If I try to, I get this error: Not an in-range integer, float, or cons of integers I traced the problem to the "XdndPosition" cond in x-dnd-handle-xdnd, which calls x-send-client-message. The "list-to-send" variable has a negative y value, which it gets from x-dnd-get-drop-x-y. I think the way to fix this is to change x-send-client-message so it accepts negative x/y values, but I'm not sure if that's correct. Thanks, Paulie --20cf301af45323189505010f0cce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
If my Emacs window is above the top of my screen (which is= how I usually have it since I don't care about the title bar, etc.), I= cannot drag a file onto the top part of the Emacs window/frame. If I try t= o, I get this error:
Not an in-range integer, float, or cons of integers

I traced the problem to the "XdndPosition" cond in=C2=A0x-d= nd-handle-xdnd, which calls=C2=A0x-send-client-message. The "list-to-s= end" variable has a negative y value, which it gets from=C2=A0x-dnd-ge= t-drop-x-y. I think the way to fix this is to change x-send-client-message = so it accepts negative x/y values, but I'm not sure if that's corre= ct.

Thanks,
Paulie
--20cf301af45323189505010f0cce-- From unknown Sat Aug 16 19:14:33 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Paulie Pena IV Subject: bug#18303: closed (Re: bug#18303: Drag and Drop fails when Emacs window/frame is above top) Message-ID: References: <540C96C9.9030108@swipnet.se> X-Gnu-PR-Message: they-closed 18303 X-Gnu-PR-Package: emacs Reply-To: 18303@debbugs.gnu.org Date: Sun, 07 Sep 2014 17:34:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1410111242-16399-1" This is a multi-part message in MIME format... ------------=_1410111242-16399-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18303: Drag and Drop fails when Emacs window/frame is above top which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18303@debbugs.gnu.org. --=20 18303: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18303 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1410111242-16399-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18303-done) by debbugs.gnu.org; 7 Sep 2014 17:33:07 +0000 Received: from localhost ([127.0.0.1]:32972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQgKp-0004FM-30 for submit@debbugs.gnu.org; Sun, 07 Sep 2014 13:33:07 -0400 Received: from mailfe06.swip.net ([212.247.154.161]:38628 helo=swip.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQgKm-0004Em-D8 for 18303-done@debbugs.gnu.org; Sun, 07 Sep 2014 13:33:05 -0400 X-T2-Spam-Status: No, hits=0.0 required=5.0 Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 527726996; Sun, 07 Sep 2014 19:32:57 +0200 Message-ID: <540C96C9.9030108@swipnet.se> Date: Sun, 07 Sep 2014 19:32:57 +0200 From: =?UTF-8?B?SmFuIERqw6Rydg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Paulie Pena IV , 18303-done@debbugs.gnu.org Subject: Re: bug#18303: Drag and Drop fails when Emacs window/frame is above top References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 18303-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Den 2014-08-20 14:50, Paulie Pena IV skrev: > If my Emacs window is above the top of my screen (which is how I usually have > it since I don't care about the title bar, etc.), I cannot drag a file onto > the top part of the Emacs window/frame. If I try to, I get this error: > Not an in-range integer, float, or cons of integers > > I traced the problem to the "XdndPosition" cond in x-dnd-handle-xdnd, which > calls x-send-client-message. The "list-to-send" variable has a negative y > value, which it gets from x-dnd-get-drop-x-y. I think the way to fix this is > to change x-send-client-message so it accepts negative x/y values, but I'm not > sure if that's correct. This has been fixed in the trunk. x-send-client-message accepted negative x, but did not accept negative y. Jan D. ------------=_1410111242-16399-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Aug 2014 15:45:49 +0000 Received: from localhost ([127.0.0.1]:48329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XK856-0008Vz-D1 for submit@debbugs.gnu.org; Wed, 20 Aug 2014 11:45:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51846) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XK5LU-0004Bo-FV for submit@debbugs.gnu.org; Wed, 20 Aug 2014 08:50:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK5LO-00072S-E8 for submit@debbugs.gnu.org; Wed, 20 Aug 2014 08:50:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5LO-00072E-Aw for submit@debbugs.gnu.org; Wed, 20 Aug 2014 08:50:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5LN-0006Du-Ds for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 08:50:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK5LM-0006z7-K6 for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 08:50:25 -0400 Received: from mail-yk0-x22c.google.com ([2607:f8b0:4002:c07::22c]:35642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5LM-0006xX-Fk for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2014 08:50:24 -0400 Received: by mail-yk0-f172.google.com with SMTP id 10so6570132ykt.3 for ; Wed, 20 Aug 2014 05:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=E5COYmGifx23A2XoVflsxiklcHC3xhrO4N5In7dXYqI=; b=xbWDVtYAA6gOSzGLyhgzKV0rSXRbfpTzhs4Tr4maj6JbLJamg7HEMOZaRO93jpMr3e dk0m7ltPZ+6cPw84QRDkpUzkt/Z6AFKiGm9UtSX1CCukB3mjc7ULZAIoRoCA/6RdVMvR 1nt6EuE4GQR3oMfAM8ytWYtqEMlmP3Q1G8EAyLur+4w2UjXJEryxFMzK9mEdZR5sRA4q /DXAmOQ0XM38pwl67HIw9zeuRTfMqzeA4rkHU6v0ORJ0CNTFKIddpyc8N7JtXV/pZ94S HjQX31+PJnohWcMLv9QhPOU8l6ESJpJtFpW+aHdyEKeN4/OSS2JRoNfJOcYKQsVy59hp gshw== X-Received: by 10.236.102.70 with SMTP id c46mr233666yhg.194.1408539023315; Wed, 20 Aug 2014 05:50:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.100.65 with HTTP; Wed, 20 Aug 2014 05:50:03 -0700 (PDT) From: Paulie Pena IV Date: Wed, 20 Aug 2014 08:50:03 -0400 Message-ID: Subject: Drag and Drop fails when Emacs window/frame is above top To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=20cf301af45323189505010f0cce X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 20 Aug 2014 11:45:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) --20cf301af45323189505010f0cce Content-Type: text/plain; charset=UTF-8 If my Emacs window is above the top of my screen (which is how I usually have it since I don't care about the title bar, etc.), I cannot drag a file onto the top part of the Emacs window/frame. If I try to, I get this error: Not an in-range integer, float, or cons of integers I traced the problem to the "XdndPosition" cond in x-dnd-handle-xdnd, which calls x-send-client-message. The "list-to-send" variable has a negative y value, which it gets from x-dnd-get-drop-x-y. I think the way to fix this is to change x-send-client-message so it accepts negative x/y values, but I'm not sure if that's correct. Thanks, Paulie --20cf301af45323189505010f0cce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
If my Emacs window is above the top of my screen (which is= how I usually have it since I don't care about the title bar, etc.), I= cannot drag a file onto the top part of the Emacs window/frame. If I try t= o, I get this error:
Not an in-range integer, float, or cons of integers

I traced the problem to the "XdndPosition" cond in=C2=A0x-d= nd-handle-xdnd, which calls=C2=A0x-send-client-message. The "list-to-s= end" variable has a negative y value, which it gets from=C2=A0x-dnd-ge= t-drop-x-y. I think the way to fix this is to change x-send-client-message = so it accepts negative x/y values, but I'm not sure if that's corre= ct.

Thanks,
Paulie
--20cf301af45323189505010f0cce-- ------------=_1410111242-16399-1-- From unknown Sat Aug 16 19:14:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18303: Drag and Drop fails when Emacs window/frame is above top References: In-Reply-To: Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Sep 2014 19:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Cc: 18303@debbugs.gnu.org Received: via spool by 18303-submit@debbugs.gnu.org id=B18303.141011945929373 (code B ref 18303); Sun, 07 Sep 2014 19:51:02 +0000 Received: (at 18303) by debbugs.gnu.org; 7 Sep 2014 19:50:59 +0000 Received: from localhost ([127.0.0.1]:33016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQiUF-0007dg-Cl for submit@debbugs.gnu.org; Sun, 07 Sep 2014 15:50:59 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:58807) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQiUC-0007dT-Vr for 18303@debbugs.gnu.org; Sun, 07 Sep 2014 15:50:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 07CDAA60005; Sun, 7 Sep 2014 12:50:51 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q4S0YvTPDQEq; Sun, 7 Sep 2014 12:50:42 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5ED5A39E8012; Sun, 7 Sep 2014 12:50:42 -0700 (PDT) Message-ID: <540CB70E.30206@cs.ucla.edu> Date: Sun, 07 Sep 2014 12:50:38 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Thanks for the patch. I noticed that '(v1 << 16) | v2' wouldn't work as desired when v2 < 0, though, as v2's sign bits will bleed into v1's encoded value. I installed an attempt at a fix as trunk bzr 117836. From unknown Sat Aug 16 19:14:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18303: Drag and Drop fails when Emacs window/frame is above top Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Sep 2014 06:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert Cc: 18303@debbugs.gnu.org Received: via spool by 18303-submit@debbugs.gnu.org id=B18303.14101592144618 (code B ref 18303); Mon, 08 Sep 2014 06:54:02 +0000 Received: (at 18303) by debbugs.gnu.org; 8 Sep 2014 06:53:34 +0000 Received: from localhost ([127.0.0.1]:33180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQspR-0001CQ-Ig for submit@debbugs.gnu.org; Mon, 08 Sep 2014 02:53:33 -0400 Received: from mailfe02.swip.net ([212.247.154.33]:54965 helo=swip.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQspP-0001CC-Hr for 18303@debbugs.gnu.org; Mon, 08 Sep 2014 02:53:32 -0400 X-T2-Spam-Status: No, hits=0.0 required=5.0 Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 530845416; Mon, 08 Sep 2014 07:04:55 +0200 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Jan =?UTF-8?Q?Dj=C3=A4rv?= In-Reply-To: <540CB70E.30206@cs.ucla.edu> Date: Mon, 8 Sep 2014 07:04:54 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <540CB70E.30206@cs.ucla.edu> X-Mailer: Apple Mail (2.1878.6) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello. 7 sep 2014 kl. 21:50 skrev Paul Eggert : > Thanks for the patch. I noticed that '(v1 << 16) | v2' wouldn't work = as desired when v2 < 0, though, as v2's sign bits will bleed into v1's = encoded value. I installed an attempt at a fix as trunk bzr 117836. Thanks, but it does not look right. We can assume v1 and v2 are 16 bit = signed integers (X coordinates). In general, when data is a CONS, it = must be two 16 bit numbers. So (v1 << 16) | v2 is just a way of stuffing two signed 16 bits into 32 = bits. But when v2 is long, (v2 & 0xffff) looses the sign bit, as the code is = now. I don't know why the range X_LONG_(MIN|MAX) >> 16 is relevant here, it = is way too large. Remember, val can only be 32 bit, so X_LONG_MAX >> 16 can in it self be = 48 bits. Maybe just convert v1 and v2 to two signed 16 bit numbers (int16_t?) and = shift? Jan D. From unknown Sat Aug 16 19:14:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18303: Drag and Drop fails when Emacs window/frame is above top Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Sep 2014 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Cc: 18303@debbugs.gnu.org Received: via spool by 18303-submit@debbugs.gnu.org id=B18303.141018185011529 (code B ref 18303); Mon, 08 Sep 2014 13:11:01 +0000 Received: (at 18303) by debbugs.gnu.org; 8 Sep 2014 13:10:50 +0000 Received: from localhost ([127.0.0.1]:33396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQyiY-0002zs-1B for submit@debbugs.gnu.org; Mon, 08 Sep 2014 09:10:50 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:59761) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQyiU-0002zb-R6 for 18303@debbugs.gnu.org; Mon, 08 Sep 2014 09:10:47 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1F54EA6001E; Mon, 8 Sep 2014 06:10:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RI01hy3x6vKi; Mon, 8 Sep 2014 06:10:36 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 21228A60014; Mon, 8 Sep 2014 06:10:36 -0700 (PDT) Message-ID: <540DAAC7.7040602@cs.ucla.edu> Date: Mon, 08 Sep 2014 06:10:31 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 References: <540CB70E.30206@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -4.8 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.8 (----) Jan Djärv wrote: > Thanks, but it does not look right. We can assume v1 and v2 are 16 bit signed integers (X coordinates). In general, when data is a CONS, it must be two 16 bit numbers. > So (v1 << 16) | v2 is just a way of stuffing two signed 16 bits into 32 bits. > But when v2 is long, (v2 & 0xffff) looses the sign bit, as the code is now. I don't see how the expression could keep the sign bit and still work. Suppose v1 == 27 and v2 == -1. Then ((v1 << 16) | v2) == -1, and we've lost all information about v1's value. In contrast, ((v1 << 16) | (v2 & 0xffff) == 1835007 == 0x1bffff, so we still can retrieve information about v1's value by shifting this value right by 16 bits. > I don't know why the range X_LONG_(MIN|MAX) >> 16 is relevant here, it is way too large. > Remember, val can only be 32 bit, so X_LONG_MAX >> 16 can in it self be 48 bits. X_LONG_MAX and X_LONG_MIN are always 32-bit values, even on platforms where long is 64 bits. So the range X_LONG_MIN >> 16 .. X_LONG_MAX >> 16 is -32768 .. 32767 which should be the correct range for X. From unknown Sat Aug 16 19:14:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18303: Drag and Drop fails when Emacs window/frame is above top Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Sep 2014 15:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert Cc: 18303@debbugs.gnu.org Received: via spool by 18303-submit@debbugs.gnu.org id=B18303.141018953228405 (code B ref 18303); Mon, 08 Sep 2014 15:19:01 +0000 Received: (at 18303) by debbugs.gnu.org; 8 Sep 2014 15:18:52 +0000 Received: from localhost ([127.0.0.1]:33982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XR0iR-0007O4-3R for submit@debbugs.gnu.org; Mon, 08 Sep 2014 11:18:51 -0400 Received: from mailfe03.swip.net ([212.247.154.65]:57159 helo=swip.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XR0iN-0007Nk-7o for 18303@debbugs.gnu.org; Mon, 08 Sep 2014 11:18:48 -0400 X-T2-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50 Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 363292403; Mon, 08 Sep 2014 17:18:39 +0200 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Jan =?UTF-8?Q?Dj=C3=A4rv?= In-Reply-To: <540DAAC7.7040602@cs.ucla.edu> Date: Mon, 8 Sep 2014 17:18:38 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <540CB70E.30206@cs.ucla.edu> <540DAAC7.7040602@cs.ucla.edu> X-Mailer: Apple Mail (2.1878.6) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello. 8 sep 2014 kl. 15:10 skrev Paul Eggert : > Jan Dj=E4rv wrote: >> Thanks, but it does not look right. We can assume v1 and v2 are 16 = bit signed integers (X coordinates). In general, when data is a CONS, = it must be two 16 bit numbers. >> So (v1 << 16) | v2 is just a way of stuffing two signed 16 bits into = 32 bits. >> But when v2 is long, (v2 & 0xffff) looses the sign bit, as the code = is now. >=20 > I don't see how the expression could keep the sign bit and still work. = Suppose v1 =3D=3D 27 and v2 =3D=3D -1. Then ((v1 << 16) | v2) =3D=3D = -1, and we've lost all information about v1's value. In contrast, ((v1 = << 16) | (v2 & 0xffff) =3D=3D 1835007 =3D=3D 0x1bffff, so we still can = retrieve information about v1's value by shifting this value right by 16 = bits. >=20 Yes, you are right. >> I don't know why the range X_LONG_(MIN|MAX) >> 16 is relevant here, = it is way too large. >> Remember, val can only be 32 bit, so X_LONG_MAX >> 16 can in it self = be 48 bits. >=20 > X_LONG_MAX and X_LONG_MIN are always 32-bit values, even on platforms = where long is 64 bits. So the range X_LONG_MIN >> 16 .. X_LONG_MAX >> = 16 is -32768 .. 32767 which should be the correct range for X. Right, I missed the X_. Jan D.