From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#38731: [PATCH] Calculate first glyph to be redrawn when exposing (bug#38731) Date: Fri, 27 Dec 2019 19:06:52 +0000 Message-ID: <20191227190652.GA92850@breton.holly.idiocy.org> References: <20191227143500.GA75733@breton.holly.idiocy.org> <20191227162620.GA92799@breton.holly.idiocy.org> <83a77dpu28.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="88328"; mail-complaints-to="usenet@blaine.gmane.org" Cc: netjune@outlook.com, 38731@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 27 20:08:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ikuyX-000Mow-PQ for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Dec 2019 20:08:41 +0100 Original-Received: from localhost ([::1]:38082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikuyW-0000X7-MS for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Dec 2019 14:08:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36828) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikuxx-0000U2-Hk for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2019 14:08:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikuxv-0007JC-Gx for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2019 14:08:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51830) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ikuxu-0007IN-KB for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2019 14:08:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ikuxu-0001YG-EL for bug-gnu-emacs@gnu.org; Fri, 27 Dec 2019 14:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Dec 2019 19:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38731 X-GNU-PR-Package: emacs Original-Received: via spool by 38731-submit@debbugs.gnu.org id=B38731.15774736285892 (code B ref 38731); Fri, 27 Dec 2019 19:08:02 +0000 Original-Received: (at 38731) by debbugs.gnu.org; 27 Dec 2019 19:07:08 +0000 Original-Received: from localhost ([127.0.0.1]:57803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikuwy-0001Ww-L4 for submit@debbugs.gnu.org; Fri, 27 Dec 2019 14:07:08 -0500 Original-Received: from mail-wr1-f65.google.com ([209.85.221.65]:43626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikuwu-0001WP-TM for 38731@debbugs.gnu.org; Fri, 27 Dec 2019 14:07:02 -0500 Original-Received: by mail-wr1-f65.google.com with SMTP id d16so26901808wre.10 for <38731@debbugs.gnu.org>; Fri, 27 Dec 2019 11:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Kvt3T40EM2exjN8KRYtE3zwkYDXUvW76YVAG1T9pjto=; b=FqsMSNuNoOaJZ4sobNurA4y2XNCc92zchsXa1aOQq7vWMNnoZdMogvyX+1P4oGYilY JZySAKjLiP0GngHPEa1E74vW/ZuXYwWhLtX0l94QijpGwk9pMckD5LOkeGMoH7WuMO+Y ABs6/GlWganGD6hFA5ZIFm/5j2oHfbf3bkF96THx0E68ikmaa7Ms7AiX4yR285T6PK1Y epUQVuy7mzKaszQs6RiSokdg9AVzZyuMbsrhdknAHenBpgjBveiSucl02dBkbi49o9I7 mS/yvSMzdBg5kJqUzjszeelmBHXVQrjj+RQs0s6jYe8gp0Mxq23vhK7lfvNRfMwQ5y+6 q8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=Kvt3T40EM2exjN8KRYtE3zwkYDXUvW76YVAG1T9pjto=; b=WJ+eYBOsQoMzPjnss20Szm135l4Xbc7dnxKlBQgRsh635ZRlI3gPtnbIGvzo2WNId/ a6Xmf+MVTeo0MEOj9B2qITY7xOOkesrfQtV6VRcLvSblqP8FnrqbtHwWLIzPz8j0d8aJ /jhQ6mhiKrgCD3ZqfwM506z5nnXuywGX66t9qmohr1Uc+F5updR8HEUq2cAS4RCSkqwW QnJqgSQiFeohTRnY7bwehhbGFIm//dYZXR45qEmLr7VPSiQsy9OUjVSZtVJHibFFTo9p oFTRTNABiXa5eW9u7WNQ4Rs5DmZKYhrmb70e4DkPFRcb+iF3gYk1dSigkjXPly9RHPqw YsNg== X-Gm-Message-State: APjAAAUTE+OJ+38PEXnqG+E3wUyxLepPDIobkNX7CWUcb24KAHkpVPSj Wr2/uv1AEfMytDZoGhLyf9k= X-Google-Smtp-Source: APXvYqxs4xNkwM828DtP5SF5PZ2Ft0JpZSq6iwjSYvr5TT5/xJkt5VB8QR5qsjGWHOpqiR6D27vZMQ== X-Received: by 2002:adf:f288:: with SMTP id k8mr55074591wro.301.1577473615017; Fri, 27 Dec 2019 11:06:55 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-5065-467f-7969-bf01.holly.idiocy.org. [2001:8b0:3f8:8129:5065:467f:7969:bf01]) by smtp.gmail.com with ESMTPSA id b10sm36560860wrt.90.2019.12.27.11.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2019 11:06:54 -0800 (PST) Content-Disposition: inline In-Reply-To: <83a77dpu28.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173833 Archived-At: On Fri, Dec 27, 2019 at 07:17:03PM +0200, Eli Zaretskii wrote: > > Date: Fri, 27 Dec 2019 16:26:20 +0000 > > From: Alan Third > > Cc: netjune@outlook.com, 38731@debbugs.gnu.org > > > > * src/xdisp.c (expose_area): When the face extends to the end of the > > line calculate the first glyph to be redrawn rather than assuming it > > starts at the first glyph in the row. > > Thanks, but can you please explain the rationale behind these changes? > I'm mildly worried why this is done in generic code, whereas the > problem was Darwin-specific. The problem only appears to be Darwin specific as the NS port uses the expose functionality for all its drawing. I have a scratch NS branch that draws to an offscreen bitmap using the normal redisplay routines and it looks fine despite using the same logic in the NS specific code. This issue doesn’t show up anywhere else because it’s a rare situation and will only appear when expose is used to redraw the frame, which makes it even rarer. If we could force Emacs to redraw using expose on X or Windows I’m certain the same problem would be observed. The actual problem is that if there is a face that’s to extend to the end of the line (for example with global-hl-line-mode) then expose_area asks draw_glyphs to draw glyph 0 at x coordinate 0, even though in this case there is horizontal scrolling in effect that means glyph 0 should be at a negative x coordinate. In my case I could see that row->x in expose_area was set to -42 but expose_area called draw_glyphs with an x parameter of 0. This offset the glyphs on the screen by 42 pixels. I could see this both in debugging printfs and by actually measuring the difference between the cursor and the equivalent text as drawn on the screen. -- Alan Third