all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Selection threshold with mouse
Date: Sun, 20 Jul 2014 20:21:38 +0300	[thread overview]
Message-ID: <83oawk3pzx.fsf@gnu.org> (raw)
In-Reply-To: <jwvmwc4x9w9.fsf-monnier+gnu.emacs.help@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 20 Jul 2014 12:44:22 -0400
> 
> >> Hmm... but don't the display matrices contain the needed info (i.e. the
> >> "left-pixel boundary position"), since it's needed to react to an
> >> expose event?
> > Not sure I follow (what does an expose event have to do with the issue
> > at hand?).
> 
> An expose event comes with pixel coordinates and we need to respond by
> drawing chars at the proper pixel positions, so we clearly need to be
> able to find the chars placed at those pixel positions as well as their
> pixel boundaries.

Yes, but in these cases we can always err on the safe side,
i.e. redraw more than strictly needed.  We cannot use this strategy in
the case in point.

> > E.g., you will be unable to use it in a function that is called
> > several times in a row, like via a numeric argument or from a keyboard
> > macro.
> 
> We could make it update glyph matrices if/when needed.

That would make Emacs much slower than it is now, because now we never
enter redisplay as long as a command runs.  You suggest to interrupt a
running command by doing a large portion of redisplay, which will slow
us down.

> > For these reasons, posn-at-x-y etc. do not rely on glyph matrices, but
> > instead simulate display.
> 
> Then I don't understand why the precise pixel position is not available.

Because the existing methods are glyph-granular, not pixel-granular.
When you tell them to stop at pixel coordinate X, they move one
"display element" (e.g., character or image) at a time, and they stop
when they are _at_or_after_ the glyph whose pixel width includes the
coordinate X.  This doesn't reliably tell you where the glyph at X
starts on display.

These methods were never designed to return the kind of information
and with the kind of accuracy that is required for implementing the
requirement we are discussing.



  reply	other threads:[~2014-07-20 17:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19  8:32 Selection threshold with mouse Tak Kunihiro
2014-07-19 17:31 ` Drew Adams
2014-07-19 23:52   ` Tak Kunihiro
2014-07-20  1:22     ` Stefan Monnier
2014-07-20  4:23       ` Eli Zaretskii
     [not found]       ` <mailman.5728.1405830249.1147.help-gnu-emacs@gnu.org>
2014-07-20 14:37         ` Stefan Monnier
2014-07-20 15:04           ` Eli Zaretskii
     [not found]           ` <mailman.5763.1405868682.1147.help-gnu-emacs@gnu.org>
2014-07-20 15:37             ` Stefan Monnier
2014-07-20 16:24               ` Eli Zaretskii
     [not found]               ` <mailman.5768.1405873481.1147.help-gnu-emacs@gnu.org>
2014-07-20 16:44                 ` Stefan Monnier
2014-07-20 17:21                   ` Eli Zaretskii [this message]
2014-07-21 14:20                     ` Stefan Monnier
2014-07-21 15:31                       ` Eli Zaretskii
2014-07-23  0:27       ` Tak Kunihiro
2014-07-25  8:41         ` Eli Zaretskii
2014-07-20  1:26     ` Michael Heerdegen
     [not found] ` <mailman.5704.1405791121.1147.help-gnu-emacs@gnu.org>
2014-07-19 18:26   ` Barry Margolin
2014-07-19 18:47     ` Eli Zaretskii
     [not found]     ` <<837g395gp2.fsf@gnu.org>
2014-07-19 19:41       ` Drew Adams

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

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

  git send-email \
    --in-reply-to=83oawk3pzx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.