From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#59778: 30.0.50; [PATCH] Fix boxed menu bar in non-toolkit X builds Date: Sat, 03 Dec 2022 22:59:03 +0100 Message-ID: <87wn78b13s.fsf@ledu-giraud.fr> References: <87edthq4vm.fsf@ledu-giraud.fr> <83cz90ck64.fsf@gnu.org> 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="27167"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59778@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 03 23:00:18 2022 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 1p1aYT-0006sA-0M for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Dec 2022 23:00:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1aYH-0004uF-0u; Sat, 03 Dec 2022 17:00:05 -0500 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 1p1aYF-0004u3-K7 for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 17:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1aYE-0002zf-SQ for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 17:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1aYE-000405-Hr for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 17:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Dec 2022 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59778-submit@debbugs.gnu.org id=B59778.167010474915346 (code B ref 59778); Sat, 03 Dec 2022 22:00:02 +0000 Original-Received: (at 59778) by debbugs.gnu.org; 3 Dec 2022 21:59:09 +0000 Original-Received: from localhost ([127.0.0.1]:53546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1aXN-0003zS-Gk for submit@debbugs.gnu.org; Sat, 03 Dec 2022 16:59:09 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:25389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1aXL-0003zM-NA for 59778@debbugs.gnu.org; Sat, 03 Dec 2022 16:59:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=/W49VkmoGFr2VUzr GC4dnxeskNepyCdrOg0eiUPB8HA=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=vW8Xo9kezKeK6otE4tlJVJjyLnDBg1sFblcz3+ T2QHlFFTNUr+/CuCOL3nfyKw3+fnLZuzYR54SHdLsDfZs3ryuB7ZfuoJW9u42leGHbfCjY v4AcOljb3Cfs2SnDBAhwCsyc4VErV9ZyjIiiK3JaWd7oTU4HYVP49KVdOuED9ZN0VoP2lY +Ku5QvnG3TymXjp4cHnIWS664kS7roCcqJmmnyVXn+WnF8lQrIbFziJxf5nnBMnVIRH1qb qPCGgFEGUDVl6YT0DJv2/4DXyrrWSgYAPqqHvjn8sCrYtMFFE3zVaD/5IAMc33VrnFFn4J +9wDx3iIt11aFwd21B+aOnPg== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 13ba1ba1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 3 Dec 2022 22:59:05 +0100 (CET) In-Reply-To: <83cz90ck64.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Dec 2022 22:21:55 +0200") 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:249884 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks, this LGTM. Could you please rebase on the current HEAD of the > master branch and resubmit? The patch doesn't apply otherwise. Thanks Eli. Here a new version compiled and (lighly) tested. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-a-boxed-menu-bar-have-a-shadow-at-its-right-end.patch >From 225955bf5ce69e49588137a4f5febbb28494f8e1 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 3 Dec 2022 22:47:02 +0100 Subject: [PATCH] Make a boxed menu bar have a shadow at its right end (bug#59778) * src/xdisp.c (display_menu_bar) [HAVE_X_WINDOWS]: Make a boxed menu bar have a shadow at its right end in non-toolkit X builds. --- src/xdisp.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index b7333dc1ee..4e087bc39b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -26312,9 +26312,8 @@ display_menu_bar (struct window *w) it.first_visible_x = 0; it.last_visible_x = FRAME_PIXEL_WIDTH (f); #elif defined (HAVE_X_WINDOWS) /* X without toolkit. */ - struct window *menu_window; - - menu_window = NULL; + struct window *menu_window = NULL; + struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); if (FRAME_WINDOW_P (f)) { @@ -26324,8 +26323,6 @@ display_menu_bar (struct window *w) init_iterator (&it, menu_window, -1, -1, menu_window->desired_matrix->rows, MENU_FACE_ID); - it.first_visible_x = 0; - it.last_visible_x = FRAME_PIXEL_WIDTH (f); } else #endif /* not USE_X_TOOLKIT and not USE_GTK */ @@ -26379,8 +26376,31 @@ display_menu_bar (struct window *w) /* Compute the total height of the lines. */ compute_line_metrics (&it); + it.glyph_row->full_width_p = true; + it.glyph_row->continued_p = false; + it.glyph_row->truncated_on_left_p = false; + it.glyph_row->truncated_on_right_p = false; #if defined (HAVE_X_WINDOWS) && !defined (USE_X_TOOLKIT) && !defined (USE_GTK) + /* Make a 3D menu bar have a shadow at its right end. */ + extend_face_to_end_of_line (&it); + if (face->box != FACE_NO_BOX) + { + struct glyph *last = (it.glyph_row->glyphs[TEXT_AREA] + + it.glyph_row->used[TEXT_AREA] - 1); + int box_thickness = face->box_vertical_line_width; + last->right_box_line_p = true; + /* Add back the space for the right box line we subtracted in + init_iterator, since the right_box_line_p flag will make the + glyph wider. We actually add only as much space as is + available for the last glyph of the menu bar and whatever + space is left beyond it, since that glyph could be only + partially visible. */ + if (box_thickness > 0) + last->pixel_width += max (0, (box_thickness + - (it.current_x - it.last_visible_x))); + } + /* With the non-toolkit version, modify the menu bar window height accordingly. */ if (FRAME_WINDOW_P (it.f) && menu_window) -- 2.38.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--