From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#26816: mouse movement support for OS X Date: Tue, 9 May 2017 23:44:35 +0100 Message-ID: <20170509224435.GB8974@breton.holly.idiocy.org> References: <20170507200034.GA661@breton.holly.idiocy.org> 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 1494369917 1225 195.159.176.226 (9 May 2017 22:45:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 May 2017 22:45:17 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 26816@debbugs.gnu.org To: "Charles A. Roelli" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 10 00:45:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1d8DsR-00006e-DQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 May 2017 00:45:07 +0200 Original-Received: from localhost ([::1]:39720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8DsW-00050y-Sb for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 May 2017 18:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8DsQ-0004zT-Jv for bug-gnu-emacs@gnu.org; Tue, 09 May 2017 18:45:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8DsM-0006re-J8 for bug-gnu-emacs@gnu.org; Tue, 09 May 2017 18:45:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d8DsM-0006rU-ET for bug-gnu-emacs@gnu.org; Tue, 09 May 2017 18:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d8DsM-0001uF-2c for bug-gnu-emacs@gnu.org; Tue, 09 May 2017 18:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 May 2017 22:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26816 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26816-submit@debbugs.gnu.org id=B26816.14943698867289 (code B ref 26816); Tue, 09 May 2017 22:45:02 +0000 Original-Received: (at 26816) by debbugs.gnu.org; 9 May 2017 22:44:46 +0000 Original-Received: from localhost ([127.0.0.1]:34729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8Ds5-0001tU-L0 for submit@debbugs.gnu.org; Tue, 09 May 2017 18:44:45 -0400 Original-Received: from mail-wr0-f181.google.com ([209.85.128.181]:35819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8Ds4-0001tI-Bs for 26816@debbugs.gnu.org; Tue, 09 May 2017 18:44:44 -0400 Original-Received: by mail-wr0-f181.google.com with SMTP id z52so19298366wrc.2 for <26816@debbugs.gnu.org>; Tue, 09 May 2017 15:44:44 -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=IPO93bN6ZmpXR15+zoWMmPxprtrhYf0Tjrhldr/fCNI=; b=MPX/E+iu6QN/t2ENVJUN5bPyTiDWlRl1pxu+sTXxhRkxNQBt3kyDZhj1c0iwn8+1Xa pRpXajxU7+v3ixh2lBl0zso/WjEG5sH7cTMiSaYAb9fW4KrLubw2g8a7BDTo/LDtEmaB JzsmpUrAv0KNkachikHhM1oNNKPx01l/PKq7W3l97HaDt5PFGn+RzGixCqGHdpDfExAs hhPeKtYxSpb/840+8RsEWLyh+Uxz55gFn3B2SwbAFg7mflbTBFwUmI8fJeKH4cehHyKO pcN0FciiXVgFc4yluXYF5OqAKlGHuOKc0ILgpSO/I0cZy9N45oChhki83FirTq64V2mg qoxw== 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=IPO93bN6ZmpXR15+zoWMmPxprtrhYf0Tjrhldr/fCNI=; b=PKjjCzBF4XBhH+Vi4PU0gfNe1S4v1UmW7TLSGSXHasrmocNLTOKXKoNUYNuVNJUi5V qObVTSMdzrWY3fWkGkfxQLaLU2jRZdQGNDfwALnxDN7Jfcwf2ppE4q2A0hgEK1aAvPyc qoCCVf66gmOhVrkfCmsP57jwIjtOIrzC5dJsqWvgs9zErW5MIdsDm+pmDim43KxWprz4 /qlmu6W+c2+Wy5GsDTRkjhCh4X0cF1tybXU0wC+8hs/gPM7gWleiU/PGBNJvUDrPNR4b agp7YRda/6r/oUeGUfi5SS2Kx3nYO8ToxwctbQVVEpbloO2u8oEVKVauk8WVOi1U76lI CF/Q== X-Gm-Message-State: AODbwcCIfhAlAEfx2Zk5K5gqIj4Fw0BaiNvM41BicukdTZUmyR2bIOSa UIUtlCofB9ke305nhM4= X-Received: by 10.223.139.20 with SMTP id n20mr1606501wra.169.1494369878619; Tue, 09 May 2017 15:44:38 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-002b-ce19-f74c-0f07.holly.idiocy.org. [2001:8b0:3f8:8129:2b:ce19:f74c:f07]) by smtp.gmail.com with ESMTPSA id u200sm2331679wmd.16.2017.05.09.15.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 15:44:37 -0700 (PDT) Content-Disposition: inline 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: 208.118.235.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:132408 Archived-At: On Tue, May 09, 2017 at 09:09:29PM +0200, Charles A. Roelli wrote: > With the frame in the taller monitor as mentioned, after calling > (set-mouse-position (selected-frame) 0 0), (mouse-position) returns (# *scratch* 0x1058883a8> 0 . 55), which happens to be about 800 pixels from > the place where it should end up (i.e. it sounds like the calculation is off > the mark by the height of the primary monitor). > > > It might be that NS_PARENT_WINDOW_TOP_POS > > isn’t taking that extra height into account. > > > > #define NS_PARENT_WINDOW_TOP_POS(f) \ > > (FRAME_PARENT_FRAME (f) != NULL \ > > ? ([[FRAME_NS_VIEW (f) window] parentWindow].frame.origin.y \ > > + [[FRAME_NS_VIEW (f) window] parentWindow].frame.size.height \ > > - FRAME_NS_TITLEBAR_HEIGHT (FRAME_PARENT_FRAME (f))) \ > > : [[[FRAME_NS_VIEW (f) window] screen] frame].size.height) > > > > That last line just takes the screen’s height, and I guess that’s > > wrong. It should probably be the top left co‐ord (origin.y + > > size.height)? > > > > I ran NS_PARENT_WINDOW_TOP_POS(f) on the frame in the taller monitor as > described, and it always returned 1680. I tried adding ([[[FRAME_NS_VIEW > (f) window] screen] frame].origin.y) to the last line in the macro you > mentioned, but this must always be returning zero, because it made no > difference and the macro still returned 1680. Hmm, this is harder than I first thought. Presumably (frame-position) returns nonsensical values on your portrait monitor, and (set-frame-position nil 0 0) also plants the frame in the wrong place (ie. not the top left)? Can you try changing that last line of NS_PARENT_WINDOW_TOP_POS to return NSScreen.screens[0].frame.size.height I *think* that should set the top left of the primary screen as (0, 0). If that works for this, there may be other places where we’re using window.screen that we’ll have to change to use the primary screen, but I’m not really sure. I wonder if it’ll break when ‘screens have separate spaces’ is turned on...? :/ Almost anything seems to work here, but I’m not using multiple monitors. -- Alan Third