From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#51411: NS port cleanups Date: Sun, 31 Oct 2021 18:34:15 +0800 Message-ID: <87lf29jxeg.fsf@yahoo.com> References: <87mtmwt3mc.fsf.ref@yahoo.com> <87mtmwt3mc.fsf@yahoo.com> <87h7d4t0er.fsf@yahoo.com> <87ee86q7jm.fsf@yahoo.com> <87ilxhmlwc.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8341"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 51411@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 31 11:35:40 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 1mh8Bg-0001vB-Fu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 11:35:40 +0100 Original-Received: from localhost ([::1]:38454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mh8Be-0007PR-QL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 06:35:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mh8B6-0007PG-Nw for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 06:35:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mh8B3-0001MI-SN for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 06:35:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mh8B3-00028S-NS for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 06:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Oct 2021 10:35:01 +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.16356764728167 (code B ref 51411); Sun, 31 Oct 2021 10:35:01 +0000 Original-Received: (at 51411) by debbugs.gnu.org; 31 Oct 2021 10:34:32 +0000 Original-Received: from localhost ([127.0.0.1]:59091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mh8Aa-00027f-6T for submit@debbugs.gnu.org; Sun, 31 Oct 2021 06:34:32 -0400 Original-Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:33910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mh8AX-00027N-OO for 51411@debbugs.gnu.org; Sun, 31 Oct 2021 06:34:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1635676463; bh=pco6MiDFQhTNkCwHV/BE/Gg+YWc4gW4u7KvUEWKaGxg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=bNflU5zjSCD0LjTXmea+cqM5tk9kvKwYlyinoLBy1y1rp7mKwkWYLBdc0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EXIcxQCC7oO HoIVEq3Ep_hyWMYceeFQWS32t99SVCbxb8.FL9ar64VHtzDJ.Ff0B1oHwfqbqJoFTddeoHWUVjtU pM6aAl2eTWhLbS365Rd_3yAAYuaRL2LTjJx6eCnf.FIyVZdk2EvEpmH4wmhr393Ql6fVZThNjInq IfmA2fQOd6NW_7g1901k8SCWj0fCFlRtSP73B5lpNKoI65qwDK_h0XShKQyWPVPJPjvfnP0zOdsC Qj1PXoYF.BuQCgOFBtHYjhPVfQkn7lTpvfbupHpb9uSrkuJPVIYhDUGvyAuggBGjHoFO853JzbQA lYwsKGvH23M5P8WjZ5wO3pW4Xueav68BAWIy84f5j6U83xrOhaBbnwWWHL7aUMJJlt0hebI1lHzR 1vdxROrv.On8s8dnZgPM7Ygg8jFaaOCHqfNtaIgjPn615tU6ecMyY6TfC8U0hYHE7iv2E3UPxNIj 4hktM91dt6_5LrPnI82yp33yWpaH6UkAX3yrbzJUePe59UW.n7tC9cVzs7Rwh6k7MqN8dpUdJazH Zwzl_r5HaaDhZK2xf0ePpmpF7Gw2hsDGNoJKDJCtwI X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sun, 31 Oct 2021 10:34:23 +0000 Original-Received: by kubenode504.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID c57b703441c09305a95699b807bcc611; Sun, 31 Oct 2021 10:34:18 +0000 (UTC) In-Reply-To: (Alan Third's message of "Sun, 31 Oct 2021 10:22:50 +0000") X-Mailer: WebService/1.1.19198 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:218670 Archived-At: 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. > 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. > 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? Thanks for the feedback, I really appreciate it.