From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.bugs Subject: bug#2530: 23/NS: redraws according to mouse-face are slow Date: Mon, 4 May 2009 18:55:09 -0400 Message-ID: References: <4383E9F6-9B66-4DA4-AA3C-D602EB059B97@gmail.com> <139B721E-A1B4-4256-B202-D4472C0331FB@gmail.com> Reply-To: David Reitter , 2530@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: multipart/signed; boundary=Apple-Mail-43--969978604; micalg=sha1; protocol="application/pkcs7-signature" X-Trace: ger.gmane.org 1241478736 28510 80.91.229.12 (4 May 2009 23:12:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 May 2009 23:12:16 +0000 (UTC) Cc: 2530@emacsbugs.donarmstrong.com, Ian Eure , Emacs-Devel devel To: Adrian Robert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 05 01:12:06 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M17KP-0007Il-Gx for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 May 2009 01:12:05 +0200 Original-Received: from localhost ([127.0.0.1]:57740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M17KO-0008JO-Qo for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 May 2009 19:12:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M17KL-0008Il-Im for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 19:12:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M17KG-0008IC-Sv for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 19:12:01 -0400 Original-Received: from [199.232.76.173] (port=46369 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M17KG-0008I8-Q7 for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 19:11:56 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47618) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M17KG-0001q2-1Y for bug-gnu-emacs@gnu.org; Mon, 04 May 2009 19:11:56 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n44NBqv7010915; Mon, 4 May 2009 16:11:53 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n44N05JM006278; Mon, 4 May 2009 16:00:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: David Reitter Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Mon, 04 May 2009 23:00:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2530 X-Emacs-PR-Package: emacs,ns X-Emacs-PR-Keywords: Original-Received: via spool by 2530-submit@emacsbugs.donarmstrong.com id=B2530.12414777245451 (code B ref 2530); Mon, 04 May 2009 23:00:05 +0000 Original-Received: (at 2530) by emacsbugs.donarmstrong.com; 4 May 2009 22:55:24 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-qy0-f110.google.com (mail-qy0-f110.google.com [209.85.221.110]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n44MtKgi005437 for <2530@emacsbugs.donarmstrong.com>; Mon, 4 May 2009 15:55:21 -0700 Original-Received: by qyk8 with SMTP id 8so7357355qyk.19 for <2530@emacsbugs.donarmstrong.com>; Mon, 04 May 2009 15:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=7ltvVMMCsrxG6tbZlXcXEysvDMkEE0y6Je2m77LViIw=; b=whqtIkuX/UAdIzQCLHlMh2DrzeJCdLPMG7yvKC+0NZRjwMBvy56w5ZfMRjhcWvs5bZ BYlPLpYtqZg8b8KOxb3oMBIB5UH2t8X501ikZZhLL+OCu7Rn9o9BGp4YG+gFHNQNE34L VjxM3QKXVLYJnMx6uydFNKtbP+5esB4osq8F0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=PoHC7DA6mO68BE8+HkmtfdgC92U4iUtLmooqX3bO0a5CR/TmUOQoQZD9K/Ter76XH1 LvPkHOBrG5WLF5wNZqzRsji1SpDBxBlpVRQNZ5h1INo0/ZkugIp+Ygv93ZSm2r+kVJ7l 0vaDcde3I9e37LzkOeRHtoD3+iy+51t596JQI= Original-Received: by 10.220.44.206 with SMTP id b14mr10231780vcf.55.1241477715025; Mon, 04 May 2009 15:55:15 -0700 (PDT) Original-Received: from scarlett.local (pool-71-162-19-47.pitbpa.east.verizon.net [71.162.19.47]) by mx.google.com with ESMTPS id 8sm1138522ywg.3.2009.05.04.15.55.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 04 May 2009 15:55:13 -0700 (PDT) In-Reply-To: <139B721E-A1B4-4256-B202-D4472C0331FB@gmail.com> X-Mailer: Apple Mail (2.930.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 04 May 2009 19:12:01 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27693 Archived-At: --Apple-Mail-43--969978604 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Apr 23, 2009, at 11:27 PM, Adrian Robert wrote: >> Does anyone have an idea how to fix issue 2530? I think this >> slowness is quite painful. In my case, it is the tabbar.el variant >> that I'm using that causes this - I'm using several overlays (for a >> tab-close button, for instance) that get redrawn one by one. I >> would imagine that this will annoy users in other use cases as well. > > Or to ask it another way, is there any reason anyone can think of > that redisplay would force calls through the x_draw_glyph_string > pathway once for every character when overlays are present? OK, my observation from tracing this is that it doesn't draw every glyph separately, but that it identifies regions of a common face, at best a full row of course. In the case of mouse-face, in the load- history-C-j example, we still have a lot of separate strings because without the mouse-face, there are still a lot of separate regions. The distinction between them may be lost (which is very unfortunate from an UI point of view), but the region identification algorithm (BUILD_GLYPH_STRINGS I suppose) doesn't see that. Now, in NS (or at least in Cocoa), there seem to be screen updates every time we draw a glyph string. 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. Note that I'm not claiming that the patch below is the right fix...: Moving the mouse a bit causes the whole mouse highlight to flicker. I suspect that it's the same underlying problem. I wonder if we need to wrap more code in NSDisableScreenUpdates. diff --git a/src/xdisp.c b/src/xdisp.c index ac989d3..fc319ca 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22790,6 +22790,10 @@ show_mouse_face (dpyinfo, draw) struct window *w = XWINDOW (dpyinfo->mouse_face_window); struct frame *f = XFRAME (WINDOW_FRAME (w)); +#ifdef NS_IMPL_COCOA + NSDisableScreenUpdates (); +#endif + if (/* If window is in the process of being destroyed, don't bother to do anything. */ w->current_matrix != NULL @@ -22852,6 +22856,9 @@ show_mouse_face (dpyinfo, draw) UNBLOCK_INPUT; } } +#ifdef NS_IMPL_COCOA + NSEnableScreenUpdates (); +#endif /* Change the mouse cursor. */ if (draw == DRAW_NORMAL_TEXT && !EQ (dpyinfo->mouse_face_window, f- >tool_bar_window)) --Apple-Mail-43--969978604 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFxDCCAn0w ggHmoAMCAQICED6shx13jEDrq0eL8FRq5ykwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA4MTIwOTAyMDgwMVoXDTA5MTIwOTAyMDgw MVowYjEQMA4GA1UEBBMHUmVpdHRlcjEOMAwGA1UEKhMFRGF2aWQxFjAUBgNVBAMTDURhdmlkIFJl aXR0ZXIxJjAkBgkqhkiG9w0BCQEWF2RhdmlkLnJlaXR0ZXJAZ21haWwuY29tMIGfMA0GCSqGSIb3 DQEBAQUAA4GNADCBiQKBgQDOdo6kAwlkBxUb8dj4saMbYg4SVng8CUePFn3cjjWrakBTbUVa4Z0n wlUxr7AitEeKhBy5nGhu96+jKUPrCwYNRCZ0l2ovvuGq4z1m1nZ5/c8WvFlVhieuxXMUfmb/O7D3 IojoX6iS8n5MNNU2IWNNT/AD3vOl6DKgOtOw4J9y+QIDAQABozQwMjAiBgNVHREEGzAZgRdkYXZp ZC5yZWl0dGVyQGdtYWlsLmNvbTAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBQUAA4GBAIjI8yEW wkiEfA9PMgpjnD6KyCXT0iZjHhW2PkR53yZZLUoTboHnKgsFwYp/gzzIL8J5cvZaRUyMUzXDuf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