From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64440: 30.0.50; [PATCH] Highlight on non toolkit menu bar items Date: Mon, 11 Sep 2023 20:56:37 +0200 Message-ID: <87jzswsfmi.fsf@ledu-giraud.fr> References: <87zg4d56l8.fsf@ledu-giraud.fr> <87ilaz1wol.fsf@ledu-giraud.fr> <87fs3xo13z.fsf@yahoo.com> <83zg259iwz.fsf@gnu.org> <878r9losil.fsf@ledu-giraud.fr> <83tts2scvp.fsf@gnu.org> <87cyyo28m0.fsf@ledu-giraud.fr> <83cyyorfnr.fsf@gnu.org> <87r0n4sqm8.fsf@ledu-giraud.fr> <835y4gr9ao.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18080"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, stefankangas@gmail.com, 64440@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 11 20:57:23 2023 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 1qfm66-0004Px-Ly for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Sep 2023 20:57:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfm5m-0003CG-Sq; Mon, 11 Sep 2023 14:57:02 -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 1qfm5i-0003C2-8b for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 14:56:59 -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 1qfm5h-0004Gz-Vz for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 14:56:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfm5m-0001rz-53 for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 14:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2023 18:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64440 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64440-submit@debbugs.gnu.org id=B64440.16944586097167 (code B ref 64440); Mon, 11 Sep 2023 18:57:02 +0000 Original-Received: (at 64440) by debbugs.gnu.org; 11 Sep 2023 18:56:49 +0000 Original-Received: from localhost ([127.0.0.1]:54853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfm5Z-0001rX-9l for submit@debbugs.gnu.org; Mon, 11 Sep 2023 14:56:49 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:33856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfm5U-0001rK-II for 64440@debbugs.gnu.org; Mon, 11 Sep 2023 14:56:48 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=NPc6HfmA bUP+V1juzBe438RHwtbhR97v1XaKwqE6ONc=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=KNCPiWf5nMHyBoyKI+ZQnj+EesFBXZ xytpHtZG73GtUrVZvHVnvNdJOoNtbZ+TeLGO/L6R5VExaMeGMgJnBbBQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=NPc6HfmAbUP+V1ju zBe438RHwtbhR97v1XaKwqE6ONc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=lyWnX1GWXk/TJXXQAptUxLvihGIwNuSlB8Tpio LcsSuq/fUX7d+O8os+w/lBChPxek/IgvBp3C5in1+EBN5hfdRMTbbGU46IUajM0+UmYWcj leYONk3YX8d+IMV4xr9Y3SiPt8NJWHeWUIRlxlRTtx1u3G+FA3soV41Ao3kB8P+wyj9eYt dMmQfmUGFhhAvU1WEm6WhBVbccevAT/daO4rcH3ortzGLsQKUqxvmFwDfBYnWoKMKiZIfu uRuEpy1pex1A0lqRZjI8ybS+mMFeCP4f/zJTFhcXpyE7/mbntv6uenIjvr2MzGQ42vR0uN ttHpFm/XPZcO92XaIIJGQ0KQ== Original-Received: from computer (82-65-148-221.subs.proxad.net [82.65.148.221]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 5d7cc860 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 11 Sep 2023 20:56:38 +0200 (CEST) In-Reply-To: <835y4gr9ao.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Sep 2023 18:58:39 +0300") 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:270074 Archived-At: Eli Zaretskii writes: [...] > Thanks. That's what I imagined we have there. So I guess considering > that a string ends where is SCHARS end is reasonable. > > But note that the above means you could also detect where each item > ends by looking for the glyph whose string position is -1. So maybe > add an assertion there that the glyph after the last character has its > position as -1, in case we could have some complications there with > double-width characters or something. What do you think of this: + /* Convert to pixels bounds. */ + row = MATRIX_ROW (w->current_matrix, *vpos); + *x_start = 0; + for (i = 0; i < *h_start; ++i) + *x_start += row->glyphs[TEXT_AREA][i].pixel_width; + + *x_end = *x_start; + for (i = *h_start; CHARPOS (row->glyphs[TEXT_AREA][i]) != -1; ++i) + *x_end += row->glyphs[TEXT_AREA][i].pixel_width; -- Manuel Giraud