From: David Reitter <david.reitter@gmail.com>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 2530@emacsbugs.donarmstrong.com, Ian Eure <ian@digg.com>,
Adrian Robert <adrian.b.robert@gmail.com>,
Emacs-Devel devel <emacs-devel@gnu.org>
Subject: bug#2530: 23/NS: redraws according to mouse-face are slow
Date: Mon, 4 May 2009 23:37:22 -0400 [thread overview]
Message-ID: <2E6E5869-2F70-4AF5-A917-7EA863D6BD42__18520.4989313663$1241495539$gmane$org@gmail.com> (raw)
In-Reply-To: <87d4aowc1l.fsf@cyd.mit.edu>
[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]
On May 4, 2009, at 9:53 PM, Chong Yidong wrote:
> I see. It seems ns_draw_glyph_string is a lot more expensive that
> x_draw_glyph_string. The show_mouse_face function assumes that the
> *_draw_glyph_string operation is relatively cheap, which is why it's
> called inside a loop.
>
> My guess is that the problem lies in the calls to ns_focus and
> ns_unfocus in ns_draw_glyph_string.
Right - but we still need them, at least for clipping.
That said, because of the clipping, calls to ns_focus may be more
expensive than desirable. We have multiple calls to
ns_draw_glyph_string, often more than one for each row, but we only
need one clipping for the whole frame. So, ideally we'd call ns_focus
outside the loops that call ns_draw_glyph_string, but the architecture
won't allow that.
>> If we wrap the code in show_mouse_face in NS[Dis|En]ableScreen, the
>> problem goes away for me (and it's not just delayed). Same for the
>> header-line/overlay issues I reported in #2530.
>
> If possible, we should minimize the amount of platform-dependent code
> inside xdisp.c. Could you experiment with putting these calls
> somewhere
> in nsterm.m, say surrounding the calls to note_mouse_highlight?
>
> Also, could it be ns_update_begin and ns_update_end that you want to
> call, instead of NSDisableScreen and NSEnableScreen?
Yes, sure, this variant works well, and it takes care of the ugly
flicker as well.
(However, when moving the mouse over a piece of text with (common)
mouse-face property, we shouldn't need to redraw in the first place,
and that should be addressed at some point, perhaps after 23.1.)
http://github.com/davidswelt/aquamacs-emacs/commit/9e98aaff17dd24ffa45743163df553938815498f
There are further places where we need it, e.g. when scrolling. Also,
scrolling with the mouse wheel doesn't always work when the mouse is
over a highlighted (mouse-faced) piece of text. Will look into this
again.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]
next prev parent reply other threads:[~2009-05-05 3:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 21:29 bug#2530: 23/NS: redraws according to mouse-face are slow Adrian Robert
2009-04-20 18:01 ` David Reitter
[not found] ` <4383E9F6-9B66-4DA4-AA3C-D602EB059B97@gmail.com>
2009-04-24 3:27 ` Adrian Robert
[not found] ` <139B721E-A1B4-4256-B202-D4472C0331FB@gmail.com>
2009-05-04 22:55 ` David Reitter
[not found] ` <B31667CB-C4A4-48A4-A1E0-7D81AD6880A3@gmail.com>
2009-05-05 1:53 ` Chong Yidong
[not found] ` <87d4aowc1l.fsf@cyd.mit.edu>
2009-05-05 3:37 ` David Reitter [this message]
[not found] ` <2E6E5869-2F70-4AF5-A917-7EA863D6BD42@gmail.com>
2009-05-05 10:36 ` Adrian Robert
[not found] ` <1ACB40A8-4422-4B9A-A0F7-FE0B9C738299@gmail.com>
2009-05-05 14:13 ` Chong Yidong
2009-05-06 0:50 ` YAMAMOTO Mitsuharu
[not found] ` <87ab5rvds7.fsf@cyd.mit.edu>
2009-05-05 17:32 ` David Reitter
2009-05-06 1:47 ` Stefan Monnier
[not found] ` <jwvbpq7m2es.fsf-monnier+emacsbugreports@gnu.org>
2009-05-06 7:40 ` YAMAMOTO Mitsuharu
[not found] ` <48600A00-7FAE-4B80-8B3D-6615230918AF@gmail.com>
2016-01-14 5:08 ` Andrew Hyatt
[not found] ` <m2k2nc7np0.fsf@gmail.com>
2016-01-14 20:34 ` Alan J Third
2016-01-14 21:00 ` David Reitter
2016-01-14 21:39 ` Christian Kruse
[not found] ` <87r3hjrgc7.fsf@motte.fritz.box>
2016-01-15 7:38 ` Eli Zaretskii
[not found] ` <837fjbgumi.fsf@gnu.org>
2016-01-16 4:15 ` Andrew Hyatt
[not found] ` <wlprenukaa.wl%mituharu@math.s.chiba-u.ac.jp>
2009-05-06 1:55 ` Adrian Robert
[not found] ` <B2B56BBA-6285-48DE-8C95-3BBCA4805146@gmail.com>
2009-05-06 2:25 ` YAMAMOTO Mitsuharu
-- strict thread matches above, loose matches on Subject: below --
2009-03-01 22:34 David Reitter
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='2E6E5869-2F70-4AF5-A917-7EA863D6BD42__18520.4989313663$1241495539$gmane$org@gmail.com' \
--to=david.reitter@gmail.com \
--cc=2530@emacsbugs.donarmstrong.com \
--cc=adrian.b.robert@gmail.com \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=ian@digg.com \
/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).