aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorManuel Giraud2022-12-03 22:47:02 +0100
committerEli Zaretskii2022-12-04 14:43:21 +0200
commita51743dbcb793d1c02f1f40b107e752c2a095ab0 (patch)
tree6608870dce18cc7b847628bd11eb9943e2432453 /src
parentf96a9e10b108237e4aa192eca962ceb0ca07e431 (diff)
downloademacs-a51743dbcb793d1c02f1f40b107e752c2a095ab0.tar.gz
emacs-a51743dbcb793d1c02f1f40b107e752c2a095ab0.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b7333dc1ee6..4e087bc39be 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -26312,9 +26312,8 @@ display_menu_bar (struct window *w)
26312 it.first_visible_x = 0; 26312 it.first_visible_x = 0;
26313 it.last_visible_x = FRAME_PIXEL_WIDTH (f); 26313 it.last_visible_x = FRAME_PIXEL_WIDTH (f);
26314#elif defined (HAVE_X_WINDOWS) /* X without toolkit. */ 26314#elif defined (HAVE_X_WINDOWS) /* X without toolkit. */
26315 struct window *menu_window; 26315 struct window *menu_window = NULL;
26316 26316 struct face *face = FACE_FROM_ID (f, MENU_FACE_ID);
26317 menu_window = NULL;
26318 26317
26319 if (FRAME_WINDOW_P (f)) 26318 if (FRAME_WINDOW_P (f))
26320 { 26319 {
@@ -26324,8 +26323,6 @@ display_menu_bar (struct window *w)
26324 init_iterator (&it, menu_window, -1, -1, 26323 init_iterator (&it, menu_window, -1, -1,
26325 menu_window->desired_matrix->rows, 26324 menu_window->desired_matrix->rows,
26326 MENU_FACE_ID); 26325 MENU_FACE_ID);
26327 it.first_visible_x = 0;
26328 it.last_visible_x = FRAME_PIXEL_WIDTH (f);
26329 } 26326 }
26330 else 26327 else
26331#endif /* not USE_X_TOOLKIT and not USE_GTK */ 26328#endif /* not USE_X_TOOLKIT and not USE_GTK */
@@ -26379,8 +26376,31 @@ display_menu_bar (struct window *w)
26379 26376
26380 /* Compute the total height of the lines. */ 26377 /* Compute the total height of the lines. */
26381 compute_line_metrics (&it); 26378 compute_line_metrics (&it);
26379 it.glyph_row->full_width_p = true;
26380 it.glyph_row->continued_p = false;
26381 it.glyph_row->truncated_on_left_p = false;
26382 it.glyph_row->truncated_on_right_p = false;
26382 26383
26383#if defined (HAVE_X_WINDOWS) && !defined (USE_X_TOOLKIT) && !defined (USE_GTK) 26384#if defined (HAVE_X_WINDOWS) && !defined (USE_X_TOOLKIT) && !defined (USE_GTK)
26385 /* Make a 3D menu bar have a shadow at its right end. */
26386 extend_face_to_end_of_line (&it);
26387 if (face->box != FACE_NO_BOX)
26388 {
26389 struct glyph *last = (it.glyph_row->glyphs[TEXT_AREA]
26390 + it.glyph_row->used[TEXT_AREA] - 1);
26391 int box_thickness = face->box_vertical_line_width;
26392 last->right_box_line_p = true;
26393 /* Add back the space for the right box line we subtracted in
26394 init_iterator, since the right_box_line_p flag will make the
26395 glyph wider. We actually add only as much space as is
26396 available for the last glyph of the menu bar and whatever
26397 space is left beyond it, since that glyph could be only
26398 partially visible. */
26399 if (box_thickness > 0)
26400 last->pixel_width += max (0, (box_thickness
26401 - (it.current_x - it.last_visible_x)));
26402 }
26403
26384 /* With the non-toolkit version, modify the menu bar window height 26404 /* With the non-toolkit version, modify the menu bar window height
26385 accordingly. */ 26405 accordingly. */
26386 if (FRAME_WINDOW_P (it.f) && menu_window) 26406 if (FRAME_WINDOW_P (it.f) && menu_window)