From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Pettersson Newsgroups: gmane.emacs.bugs Subject: bug#71763: [PATCH] Inconsistency in bitmap overlay drawing for macOS Date: Tue, 25 Jun 2024 00:04:27 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29465"; mail-complaints-to="usenet@ciao.gmane.io" To: 71763@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 25 00:07:22 2024 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 1sLrqL-0007SC-9U for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jun 2024 00:07:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLrq3-0002nD-Jt; Mon, 24 Jun 2024 18:07:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLrq1-0002mx-Pp for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 18:07:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLrq1-0005L0-I2 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 18:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLrq1-0007pI-Ro for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 18:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2024 22:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71763 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171926680730050 (code B ref -1); Mon, 24 Jun 2024 22:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jun 2024 22:06:47 +0000 Original-Received: from localhost ([127.0.0.1]:35756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLrpn-0007ob-5V for submit@debbugs.gnu.org; Mon, 24 Jun 2024 18:06:47 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLrpl-0007oT-CQ for submit@debbugs.gnu.org; Mon, 24 Jun 2024 18:06:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLrnd-0002Rq-T4 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 18:04:33 -0400 Original-Received: from mail-lj1-f173.google.com ([209.85.208.173]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLrnb-0004rG-Un for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 18:04:33 -0400 Original-Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2ec52fbb50aso32254551fa.3 for ; Mon, 24 Jun 2024 15:04:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719266669; x=1719871469; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=shmTltRiX9vTur5qHfh86NnrJZsVHATlcnZOMk662j0=; b=r9CQdGpiL+9ABjVe9QlOd8jLEpbG81PwQ9FqijsSYC9MafBuAb6gIIGKyZMvbH3A+H eJIb8eXYR2yv6pGlD8adG4+Xyw1i0b0jXB0EJNYDIvLv85NNgqNDAYrp5Z2z62sQlv8Q RoT7dfmyIdBdMNJ7TsV0RDhLFAYRUzyJaJx8y3mu72nl6Gica5/J/91j03U3SsB9E5Gr wQXyVroHuDsZV6VyYpZjwEKvgY2XQkahDmDGbnp5ra/jXaq+Sf4PXgozf7sGqinVE5Ca eyS0hv4Iq7y5DqkrJp6TJChMq78VNmyiqXilSAitLH9du988CGMyeqvqc970lb78jtx5 1/YA== X-Gm-Message-State: AOJu0YzGf1Wal+ZFjvwbeA8kS0XRy3mbkKCyJXRToCn9O5qL62bJrm7z 3rb5k/dLfL05BIANXex2eyIU0t/8G/RiM90CORuSYoVjXTKdUYULZKp5SA== X-Google-Smtp-Source: AGHT+IHu44aM9RsADtrTlpietjXmBjKCkpsK5ZJvpA4/t2xujh7RIGZkp0UCO1a6H8GGls7Q9Wt4tw== X-Received: by 2002:a05:651c:152:b0:2ec:5785:ee97 with SMTP id 38308e7fff4ca-2ec5b36c1afmr38879041fa.53.1719266668741; Mon, 24 Jun 2024 15:04:28 -0700 (PDT) Original-Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ec64af4afdsm2139601fa.55.2024.06.24.15.04.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 15:04:28 -0700 (PDT) Received-SPF: pass client-ip=209.85.208.173; envelope-from=daniel.dpettersson.net@gmail.com; helo=mail-lj1-f173.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287862 Archived-At: --=-=-= Content-Type: text/plain On macOS overlay-arrow is not draw on top of bitmaps already present in the fringe, like its done on X Window System (src/xterm.c). This is to the detriment of gdb-mi.el where the overlay-arrow hides the breakpoint when they exist on the same row. It can be reproduced with the following: (require 'gdb-mi) (defvar overlay-arrow (make-marker)) (add-to-list 'overlay-arrow-variable-list 'overlay-arrow) (setq fringe-indicator-alist '((overlay-arrow . hollow-right-triangle))) (overlay-put (make-overlay (pos-bol) (1+ (pos-bol))) 'before-string (propertize " " 'display `(left-fringe breakpoint warning))) (move-marker overlay-arrow (pos-bol)) I expect that macOS is not using overlay_p param as intended as fixed by attached patch. But I was having an hard time finding any documentation proving my point other then the implementation of it's X Window System sibling in src/xterm.c. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-inconsistency-in-bitmap-overlay-drawing-for-macO.patch >From 492a26a4296fc8a7558b488796840c22c977d75c Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Mon, 24 Jun 2024 23:16:59 +0200 Subject: [PATCH] Fix inconsistency in bitmap overlay drawing for macOS * src/nsterm.m (ns_draw_fringe_bitmap): Respect overlay_p by not clearing fringe if set, as its done in xterm. --- src/nsterm.m | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 794630de1c1..fc9133071ed 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2961,24 +2961,28 @@ Hide the window (X11 semantics) NSTRACE_MSG ("which:%d cursor:%d overlay:%d width:%d height:%d period:%d", p->which, p->cursor_p, p->overlay_p, p->wd, p->h, p->dh); - /* Work out the rectangle we will need to clear. */ - clearRect = NSMakeRect (p->x, p->y, p->wd, p->h); + /* Clear screen unless overlay. */ + if ( !p->overlay_p ) + { + /* Work out the rectangle we will need to clear. */ + clearRect = NSMakeRect (p->x, p->y, p->wd, p->h); - if (p->bx >= 0 && !p->overlay_p) - clearRect = NSUnionRect (clearRect, NSMakeRect (p->bx, p->by, p->nx, p->ny)); + if ( p->bx >= 0 ) + clearRect = NSUnionRect (clearRect, NSMakeRect (p->bx, p->by, p->nx, p->ny)); - /* Handle partially visible rows. */ - clearRect = NSIntersectionRect (clearRect, rowRect); + /* Handle partially visible rows. */ + clearRect = NSIntersectionRect (clearRect, rowRect); - /* The visible portion of imageRect will always be contained within - clearRect. */ - ns_focus (f, &clearRect, 1); - if (! NSIsEmptyRect (clearRect)) - { - NSTRACE_RECT ("clearRect", clearRect); + /* The visible portion of imageRect will always be contained + within clearRect. */ + ns_focus (f, &clearRect, 1); + if ( !NSIsEmptyRect (clearRect) ) + { + NSTRACE_RECT ("clearRect", clearRect); - [[NSColor colorWithUnsignedLong:face->background] set]; - NSRectFill (clearRect); + [[NSColor colorWithUnsignedLong:face->background] set]; + NSRectFill (clearRect); + } } NSBezierPath *bmp = [fringe_bmp objectForKey:[NSNumber numberWithInt:p->which]]; -- 2.39.3 (Apple Git-145) --=-=-= Content-Type: text/plain In GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.1.0, NS appkit-2487.20 Version 14.1.1 (Build 23B81)) of 2024-06-24 built on Daniels-Air Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.1.1 Configured using: 'configure --with-xwidgets' Configured features: ACL DBUS GLIB GNUTLS LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB --=-=-=--