From 401ccb0b9c697fd3af026a72b6621a692e206aea Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 26 Jan 2022 13:53:20 +0800 Subject: [PATCH] Fix GTK menu bar height reporting when scaled * src/gtkutil.c (xg_update_frame_menubar): Multiply requisition height by GDK scale. --- src/gtkutil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gtkutil.c b/src/gtkutil.c index 607cf5ee2e4..98907bf0223 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -4012,6 +4012,7 @@ xg_update_frame_menubar (struct frame *f) { xp_output *x = f->output_data.xp; GtkRequisition req; + int scale = xg_get_scale (f); if (!x->menubar_widget || gtk_widget_get_mapped (x->menubar_widget)) return; @@ -4029,9 +4030,9 @@ xg_update_frame_menubar (struct frame *f) gtk_widget_show_all (x->menubar_widget); gtk_widget_get_preferred_size (x->menubar_widget, NULL, &req); req.height *= xg_get_scale (f); - if (FRAME_MENUBAR_HEIGHT (f) != req.height) + if (FRAME_MENUBAR_HEIGHT (f) != (req.height * scale)) { - FRAME_MENUBAR_HEIGHT (f) = req.height; + FRAME_MENUBAR_HEIGHT (f) = req.height * scale; adjust_frame_size (f, -1, -1, 2, 0, Qmenu_bar_lines); } unblock_input (); -- 2.39.2