From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#51411: NS port cleanups Date: Sun, 31 Oct 2021 10:59:40 +0000 Message-ID: References: <87mtmwt3mc.fsf.ref@yahoo.com> <87mtmwt3mc.fsf@yahoo.com> <87h7d4t0er.fsf@yahoo.com> <87ee86q7jm.fsf@yahoo.com> <87ilxhmlwc.fsf@yahoo.com> <87lf29jxeg.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1874"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51411@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 31 12:00:30 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mh8Zh-0000Gd-3E for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 12:00:29 +0100 Original-Received: from localhost ([::1]:45144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mh8Zf-0004Yx-BX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 07:00:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mh8ZH-0004Yn-4v for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 07:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mh8ZG-0004BL-Sa for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 07:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mh8ZG-0002nI-RI for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 07:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Oct 2021 11:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51411 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51411-submit@debbugs.gnu.org id=B51411.163567798610689 (code B ref 51411); Sun, 31 Oct 2021 11:00:02 +0000 Original-Received: (at 51411) by debbugs.gnu.org; 31 Oct 2021 10:59:46 +0000 Original-Received: from localhost ([127.0.0.1]:59106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mh8Z0-0002mK-GK for submit@debbugs.gnu.org; Sun, 31 Oct 2021 06:59:46 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:57955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mh8Yy-0002mC-Jl for 51411@debbugs.gnu.org; Sun, 31 Oct 2021 06:59:45 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 0E4A092; Sun, 31 Oct 2021 10:59:43 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1635677982; bh=LBrdcWId1Y1cGLIMnRQ3fB1Szd+jf2cDsDMc8tcP3dQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EUvwCqtSs9DZp4Uw+GI4siesD5iC/LHccD2aYCwponK8dxGw215PsGMV3ompiOpbD s4B2j1cMCED3HkxPvs1Y9ROzgG8U2zuvVZb+TDLRsSBbQZ6JtKmqXGn7svg9OwJSB8 sH0FRMvcgLjnR/pPXmVwPqJ29uGrY0jS/PAWwD+mZ349jWUHGYshqsl6dFhkL8rqIU v7qoT7HESkyYN3Bwh8bKv3U+uhnPzRSo6c1OZkh2o+riYFYrGGYX1FUpa9xq9zk/j+ ToIX3wKw0PHf/0sTVUWawH0Q1rK7EqrgJgmBaHmBwOTkGdm1jcaRnFo1Gct1PVtAMM jOyCWFwbugCEA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2) (envelope-from ) id 1mh8Yu-00033T-AL; Sun, 31 Oct 2021 10:59:40 +0000 Mail-Followup-To: Alan Third , Po Lu , 51411@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <87lf29jxeg.fsf@yahoo.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218672 Archived-At: On Sun, Oct 31, 2021 at 06:34:15PM +0800, Po Lu wrote: > Alan Third writes: > > > I think what you'll need to do is union the two rectangles and then > > clip to that, rather than clipping them both separately. That will > > then provide the same clipping as the NSClipRect code does. > > I meant to say that DPSrectclip intersects (IOW, behaves just as > NSClipRect does). Unless that's incorrect, I think what I'm doing right > now should work fine. When there are two rectangles we use NSRectClipList, which behaves a little differently. It uses the union of the two rectangles to intersect with the existing clipping. So you'll have to do something like u = NSUnionRect (r[0], r[1]); DPSrectclip (ctx, NSMinX (u), NSMinY (u), NSWidth (u), NSHeight (u)); > > I must be failing to communicate well, we keep seeming to > > misunderstand each other. > > It could be my problem as well: my reading comprehension is nowhere near > as good as I would rather it be. Thanks a lot for tolerating it. It turns out in this case I'm getting confused over what's changed in each patch! Entirely my fault. > > You still need to focus, however you don't have to clip when you > > focus. > > After I unfocus here: > > /* Draw box if not done already. */ > if (!s->for_overlaps && !box_drawn_p && s->face->box != FACE_NO_BOX) > ns_dumpglyphs_box_or_relief (s); > > -> ns_unfocus (s->f); > > I make sure to focus again if an overhang might be drawn again (inside > if (s->prev) and if (s->next)), like so: > > /* Draw surrounding overhangs. */ > if (s->prev) > { > -> ns_focus (s->f, NULL, 0); > struct glyph_string *prev; > > There is, of course, a matching unfocus. Is that not adequate, and if > so, could you please explain how? Sorry, I've got confused. What you're doing here now is good. I noticed that you removed all calls to ns_focus in ns_draw_window_cursor and thought you'd removed all calls to ns_focus, but now I see that's an older change. Is that a good idea? I think ns_draw_window_cursor is sometimes called without matching ns_update_begin/end calls, so it needs to focus, or am I misunderstanding the flow? -- Alan Third