From: "Charles A. Roelli" <charles@aurox.ch>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 26905@debbugs.gnu.org
Subject: bug#26905: 25.2: MacOS: tooltips show in wrong display
Date: Sat, 13 May 2017 16:04:32 +0200 [thread overview]
Message-ID: <16a6fc81-06de-8c4a-8159-2f07f50f5585@aurox.ch> (raw)
In-Reply-To: <83o9ux84h4.fsf@gnu.org>
FWIW, I found this change to the Windows port of Emacs (not sure if it
was ever committed):
https://lists.gnu.org/archive/html/bug-gnu-emacs/2007-07/msg00153.html
And a more recent change as a result of #22549: commit
c77ffc8019bceb850a794c13f2e3ad991cc7e412, with changes to xfns.c.
c77ffc8..: Oscar Fuentes 2016-02-06 Use monitor's resolution for
positioning tooltips
commit c77ffc8019bceb850a794c13f2e3ad991cc7e412
Author: Oscar Fuentes <ofv@wanadoo.es>
Date: Sat Feb 6 22:12:53 2016 +0100
Use monitor's resolution for positioning tooltips
* src/xfns.c (compute_tip_xy): Use the resolution of the monitor where
the mouse pointer is to avoid placing the tooltip over the border of
the monitor on multi-head displays. Fixes bug#22549.
Seems like the Windows and X versions nowadays have a check that looks
like this:
else if (*root_x + XINT (dx) <= min_x)
*root_x = 0; /* Can happen for negative dx */
i.e. compare *root_x + XINT (dx) against the variable "min_x", rather
than comparing against zero, as is done in the NS port. Since frames can
be in the negative coordinate space, it makes sense to allow a tooltip
to have a x-coordinate less than 0 -- so the NS port's code should
probably be changed.
I'm also not sure why, in the above code from the Windows and X
versions, *root_x is constrained to zero if *root_x + dx goes below
min_x. Wouldn't it make more sense to constrain to min_x, which could
be negative?
On 13/05/2017 11:56, Eli Zaretskii wrote:
>> From: "Charles A. Roelli" <charles@aurox.ch>
>> Date: Sat, 13 May 2017 11:02:04 +0200
>>
>> If I remove the marked lines in compute_tip_xy:
>>
>> if (INTEGERP (left) || INTEGERP (right))
>> *root_x = pt.x;
>> => else if (pt.x + XINT (dx) <= 0)
>> => *root_x = 0; /* Can happen for negative dx */
>> else if (pt.x + XINT (dx) + width
>> <= x_display_pixel_width (FRAME_DISPLAY_INFO (f)))
>> /* It fits to the right of the pointer. */
>> *root_x = pt.x + XINT (dx);
>> else if (width + XINT (dx) <= pt.x)
>> /* It fits to the left of the pointer. */
>> *root_x = pt.x - width - XINT (dx);
>> else
>> /* Put it left justified on the screen -- it ought to fit that way. */
>> *root_x = 0;
>>
>> Then the problem is gone.
> Those lines were added to fix some problems (whose particulars I
> cannot find at the moment), so we shouldn't remove them without
> understanding what is going on.
next prev parent reply other threads:[~2017-05-13 14:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-13 7:43 bug#26905: 25.2: MacOS: tooltips show in wrong display Charles A. Roelli
2017-05-13 9:02 ` Charles A. Roelli
2017-05-13 9:56 ` Eli Zaretskii
2017-05-13 14:04 ` Charles A. Roelli [this message]
2017-05-13 15:28 ` Alan Third
2017-05-16 21:56 ` bug#26905: [PATCH] Show tooltip on correct screen (bug#26905) Alan Third
2017-05-19 16:30 ` Charles A. Roelli
2017-05-20 23:15 ` Alan Third
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=16a6fc81-06de-8c4a-8159-2f07f50f5585@aurox.ch \
--to=charles@aurox.ch \
--cc=26905@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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).