unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Charles A. Roelli" <charles@aurox.ch>
Cc: 26816@debbugs.gnu.org
Subject: bug#26816: mouse movement support for OS X
Date: Tue, 9 May 2017 23:44:35 +0100	[thread overview]
Message-ID: <20170509224435.GB8974@breton.holly.idiocy.org> (raw)
In-Reply-To: <b2270f81-3460-9d02-8257-661eb1b61c9a@aurox.ch>

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 (#<frame
> *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





  reply	other threads:[~2017-05-09 22:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 15:11 bug#26816: mouse movement support for OS X Charles A. Roelli
2017-05-07 16:51 ` Eli Zaretskii
2017-05-08 18:34   ` Charles A. Roelli
2017-05-08 18:54     ` Eli Zaretskii
2017-05-07 18:07 ` martin rudalics
2017-05-07 20:00 ` Alan Third
2017-05-09 19:09   ` Charles A. Roelli
2017-05-09 22:44     ` Alan Third [this message]
2017-05-11 18:06       ` Charles A. Roelli
2017-05-11 21:43         ` Alan Third
2017-05-14 13:29           ` Charles A. Roelli
2017-05-14 13:59             ` Alan Third
2017-05-14 14:37               ` Eli Zaretskii
2017-05-15 18:23                 ` Charles A. Roelli
2017-05-16 22:53                   ` Alan Third
2017-05-17  8:36                     ` Andreas Schwab
2017-05-18 19:43                       ` Charles A. Roelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170509224435.GB8974@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=26816@debbugs.gnu.org \
    --cc=charles@aurox.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).