From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#28621: Proposed patch for doc of posn-window and code of posn-set-point to handle frame arguments Date: Thu, 27 Jun 2019 08:27:49 -0400 Message-ID: References: <83k20h5m2x.fsf@gnu.org> Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-2D1E786F-89B7-4381-8BB9-D52B82D99CC6 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="199577"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 28621@debbugs.gnu.org, Robert Weiner To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 27 14:28:30 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgTVt-000pnz-KG for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 14:28:29 +0200 Original-Received: from localhost ([::1]:50322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgTVs-0005aP-AZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 08:28:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48695) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgTVT-0005Rx-PM for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 08:28:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgTVS-00080e-7v for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 08:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52330) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgTVR-000809-VE for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 08:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgTVR-0005D3-QN for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 08:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jun 2019 12:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28621 X-GNU-PR-Package: emacs Original-Received: via spool by 28621-submit@debbugs.gnu.org id=B28621.156163848020019 (code B ref 28621); Thu, 27 Jun 2019 12:28:01 +0000 Original-Received: (at 28621) by debbugs.gnu.org; 27 Jun 2019 12:28:00 +0000 Original-Received: from localhost ([127.0.0.1]:37641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgTVQ-0005Co-FB for submit@debbugs.gnu.org; Thu, 27 Jun 2019 08:28:00 -0400 Original-Received: from mail-qt1-f173.google.com ([209.85.160.173]:40985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgTVN-0005CY-3R for 28621@debbugs.gnu.org; Thu, 27 Jun 2019 08:27:58 -0400 Original-Received: by mail-qt1-f173.google.com with SMTP id d17so2160076qtj.8 for <28621@debbugs.gnu.org>; Thu, 27 Jun 2019 05:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pYCQsdb9lFNoGC//JVJy9DmkSiCcNUL/pVux5z1LI40=; b=CIaYEvqn172uv0kDonlIO5BIwHBXQfRinw1zjRDbzFdsA5dPRgFpp+BC8JdIALSXub dIG3p1a5B5M1+Q7bXEFlbsfCUBJig5mm3oJTbI+lPZTh/C/ReVowpOV55KR1Aq9+TJyC 87zvIcfQla5V3DAicGyw4pTYGVV7prmZGFtX5hxRlmY78cHiU6s+o3iMJM+LPrlrjyzW 81FQEBh+Rak3QAqbtU6uqxBKrdMuG4A9OmiE6U4GrfB3qGpZsPNKyjWWS2RyuyZIoxXu GMtZhks3dMnpQy6nWLssWpenbn364UMLvagUQEZxOJBhLYtH6aIiCmCC+pB4ZDiPurG6 K45g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pYCQsdb9lFNoGC//JVJy9DmkSiCcNUL/pVux5z1LI40=; b=X2Rz4eR/RQCaN3ezYQrrU15BmqA5KMaUtjOvMd+f2ImPxuUlnz7RhxyDkxYg31B+oD dBvnJ8PqOodkgb42Wehfz27kussW+RPrBVXPUUtqdXFYpDCf6X0061N2I2hxUwhEmryJ 1YGP4v2i+PwDwe5l/aZaaPhaixgPFZGLWF8b6fd1gEWEnhK6kHV+jKPVUJYrNMaxYKmS tlmXvD7bX2u0K0W7cGgYySrWHt1nbJbG0S2zdZL1vEvgmtT2dWMDtBbo8WJ6L9ambnfn Ygf3dQ+P6dqgv+4zOpRlp6ipzaxOpXkcn14K2QyPypQVCFLYBSt90bD81pwoSmIJZxSK Z7lg== X-Gm-Message-State: APjAAAVSzAMb0+GvxxbG6AjVkra7dHkQM4uugwRWC5+B3PvB5XXJH15l ReAKzZfbstHwrToGJNjrXLjTFz23 X-Google-Smtp-Source: APXvYqwhBDExNvP4ZPFUIHhz8Wo4IMHXz4bzdUI2uxCf7sIAvIukuX/Eloaa4x9IKANvjKu6X37ngQ== X-Received: by 2002:ac8:2a99:: with SMTP id b25mr2858612qta.223.1561638471111; Thu, 27 Jun 2019 05:27:51 -0700 (PDT) Original-Received: from [192.168.10.123] (ool-2f1481cf.dyn.optonline.net. [47.20.129.207]) by smtp.gmail.com with ESMTPSA id e125sm835290qkd.120.2019.06.27.05.27.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 05:27:50 -0700 (PDT) X-Mailer: iPhone Mail (16E227) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161583 Archived-At: --Apple-Mail-2D1E786F-89B7-4381-8BB9-D52B82D99CC6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On Jun 26, 2019, at 10:20 PM, Robert Weiner wrote: >=20 > I think all my changes are in the first message here. Lars, can you see a= bout integrating from there? Thanks. >=20 Plus, this message now that I have re-read the thread. I think the main iss= ue was just documenting the changes in NEWS, Changes, the manuals, etc. I h= ave been using these patches for all this time now with Hyperbole=E2=80=99s c= ross-frame drags on multiple platforms under Emacs 26 without incident. It w= ould be great to see this moved forward. =E2=80=94 Bob Robert Weiner writes: I wrote: >=20 > =E2=80=8BThe issue, to recap, is that I can't find a function that > will report the window that a mouse release button event > occurs in if the depress and release are in different frames > (for Emacs 25). >=20 > In fact, the release event (drag event) contains the wrong > frame (that of the depress rather than the release). The wrong=20 > frame is also reported by mouse-position and mouse-pixel-position, > so window-at can't be used either. Show Quoted Content >=20 > =E2=80=8BThe issue, to recap, is that I can't find a function that > will report the window that a mouse release button event > occurs in if the depress and release are in different frames > (for Emacs 25). >=20 > In fact, the release event (drag event) contains the wrong > frame (that of the depress rather than the release). The wrong=20 > frame is also reported by mouse-position and mouse-pixel-position, > so window-at can't be used either. The following is a temporary fix for the mouse-position and mouse-pixel-position part of the problem. Something needs to be fixed in the original functions in the C code, though. -- Bob ;; =46rom mouse-position: ;; f =3D 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. ;; The problem occurs on other systems as well, e.g. Emacs 25.2 under Windo= ws 7. ;; The function below is a temporary fix for this. (setq mouse-position-function (lambda (frame-x-dot-y) "Under macOS, mouse-position and mouse-pixel-position sometimes fail to r= eturn the selected-frame (returning the prior frame instead); fix that here.= " (setcar frame-x-dot-y (selected-frame)) frame-x-dot-y)) --Apple-Mail-2D1E786F-89B7-4381-8BB9-D52B82D99CC6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Jun 26, 2019, at 10= :20 PM, Robert Weiner <rswgnu@gmail.c= om> wrote:

I think all my changes are in the first message here.  Lars, can yo= u see about integrating from there?  Thanks.

Plus, this message now that I have re-rea= d the thread.  I think the main issue was just documenting the changes i= n NEWS, Changes, the manuals, etc.  I have been using these patches for= all this time now with Hyperbole=E2=80=99s cross-frame drags on multiple pl= atforms under Emacs 26 without incident.  It would be great to see this= moved forward.  =E2=80=94 Bob

Robert Weiner <rsw@gnu.org> w= rites:

I wrote:
Show Quoted Content

The following is a temporary fix for the mo= use-position and
mouse-pixel-position part of the problem.  Somethin= g needs to be fixed
in the original functions in the C code, though. &nbs= p;-- Bob

;; =46rom mouse-position:
;;    f =3D SELE= CTED_FRAME ();
;;    XSETFRAME (lispy_dummy, f);
;; &nb= sp;It seems like the XSETFRAME macro is not properly copying the value of f o= n initial frame selection under the macOS window system.
;;  The pro= blem occurs on other systems as well, e.g. Emacs 25.2 under Windows 7.
;;=  The function below is a temporary fix for this.
(setq mouse-positi= on-function
     (lambda (frame-x-dot-y)
&nbs= p;  "Under macOS, mouse-position and mouse-pixel-position sometimes fai= l to return the selected-frame (returning the prior frame instead); fix that= here."
   (setcar frame-x-dot-y (selected-frame))
  &n= bsp;frame-x-dot-y))

= --Apple-Mail-2D1E786F-89B7-4381-8BB9-D52B82D99CC6--