From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Emacs 26: Code that fixes mouse-drag-and-drop-region to work across frames Date: Wed, 1 Nov 2017 17:16:58 +0000 Message-ID: <20171101171658.GB78963@breton.holly.idiocy.org> References: <86d15rjrpe.fsf@misasa.okayama-u.ac.jp> <86tvywotlz.fsf@misasa.okayama-u.ac.jp> <861sli69gj.fsf@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1509556637 23355 195.159.176.226 (1 Nov 2017 17:17:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Nov 2017 17:17:17 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) Cc: Tak Kunihiro , emacs-devel To: rswgnu@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 01 18:17:13 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9wdb-0005Kw-7l for ged-emacs-devel@m.gmane.org; Wed, 01 Nov 2017 18:17:11 +0100 Original-Received: from localhost ([::1]:57061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9wdg-0000yL-Ng for ged-emacs-devel@m.gmane.org; Wed, 01 Nov 2017 13:17:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9wdT-0000vd-PC for emacs-devel@gnu.org; Wed, 01 Nov 2017 13:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9wdS-00045x-Np for emacs-devel@gnu.org; Wed, 01 Nov 2017 13:17:03 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:51293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9wdS-00044w-HG for emacs-devel@gnu.org; Wed, 01 Nov 2017 13:17:02 -0400 Original-Received: by mail-wm0-x234.google.com with SMTP id b9so6285814wmh.0 for ; Wed, 01 Nov 2017 10:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=O6rEitXXY+tEA32CtHkOugt3gzIu+qGEvliXWKyMjyU=; b=rfpfpjxBaCx3xg8GGEb4PYw/BkDF6Q9kaZQRXbYUYheDTBJb+IgOqPBSeqbiUplPp7 ssDQhlA2lOEhLa+G9cHNqC7Je8KnQkS9s53cw18n3jEmtIG6MJtMPoOF9N+/WE03CQJL tgf5m4zDjM9HVgj8SRPZKB4caGqH0qRoO1K4kZTry6CiaIdvYpd6gjcOQukqJ12FGJ+/ 0LucWUFonq2/AU4TSrtUCZdjLrfHeyOnRe+6IK24P5yq+PrqCslYcD1ajqx3RERRscLk WDfYPSsvkdUy6dkNXu3mjst9Uj37RX6T+nYzB8u1S+movIAm0QMhWdH4gBUd3YLB4Ynq it/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=O6rEitXXY+tEA32CtHkOugt3gzIu+qGEvliXWKyMjyU=; b=tfzt9eRDLellNlVRhuV6qEjkAKCBYgLmvKqvu/bawyPaZ+AueqBOBSvP37dH6h/kQg rOLQnFNMExPcg1H+9lDwKX69afgKXOYX19ZrajjXQq2F79mmE0ePFo14c5fmZnE7gVVF DMTELXQtC/FX1Jy4pwpi7GV/h4YCFta6vh7z6JKRISh3ex60bSZ5Rozch4ICllvTl1vx 7ug6R2oKaC54HKAaCcRE6QS3UaIGwssj4tIOeKzFDcyIrpHFllGyaUEopkgJH2pN4iRq ept97ebW1FFTsBwoVzUodUb4Tu39H4IGDadlCqjrRH2lQlVRURRLJaOIzd8QcYrfKxhM 3q9A== X-Gm-Message-State: AMCzsaXN35E3LZs9itOkY365tSG3azePfMcuD/MugNutbKfvQ+Lw/u34 giuW7seIULfVCgzcRh2+6k4= X-Google-Smtp-Source: ABhQp+QybPkvFPzICSrj/HvyftercNa5u6d3zHu4CrF1A9EIK0VpD3lVHEaCcDq0GvUyPs+zMseVJA== X-Received: by 10.28.150.144 with SMTP id y138mr767859wmd.145.1509556621238; Wed, 01 Nov 2017 10:17:01 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-6576-6f9f-b864-9647.holly.idiocy.org. [2001:8b0:3f8:8129:6576:6f9f:b864:9647]) by smtp.gmail.com with ESMTPSA id f6sm385398wre.66.2017.11.01.10.16.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 10:17:00 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219849 Archived-At: On Wed, Nov 01, 2017 at 11:24:44AM -0400, Robert Weiner wrote: > ​Maybe it would be best if someone fixed the XSETFRAME macro in > ​mouse-position so it works properly under the macOS window system so we > could avoid any work arounds on this. -- Bob > > From mouse-position: > ;; f = SELECTED_FRAME (); > ;; XSETFRAME (lispy_dummy, f); > ;; It seems like the XSETFRAME macro is not properly copying the value > of f on initial frame selection under the macOS window system. That’s not the problem. I’ve explained this to you before. ns_mouse_position uses dpyinfo->last_mouse_frame, which is set in mouseDown. MouseDown is *not called* on macOS for the first click, instead the frame is selected. This means, like other macOS applications, the first click in the window JUST selects that window, it has no other effect. The docstring for mouse-position says: Return a list (FRAME X . Y) giving the current mouse frame and position. To my way of reading that, ‘current mouse frame’ != ‘current selected frame’, it will be the last frame that a mouse action of some sort was registered in. On macOS that doesn’t include the first click in the frame as it’s not registered as an input by Emacs. Is this behaviour wrong? I don’t know, but it seems to match the documentation. I’m sure Martin suggested this before, but if you’re trying to implement cross‐frame/window dragging, would it not be better to try and use the standard implementation for each platform? -- Alan Third