From: Po Lu Date: Wed, 26 Jan 2022 05:53:20 +0000 (+0800) Subject: Fix GTK menu bar height reporting when scaled X-Git-Tag: emacs-29.0.90~2739 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=401ccb0b9c697fd3af026a72b6621a692e206aea;p=emacs.git Fix GTK menu bar height reporting when scaled * src/gtkutil.c (xg_update_frame_menubar): Multiply requisition height by GDK scale. --- 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 ();