diff options
author | Po Lu <luangruo@yahoo.com> | 2022-01-26 13:53:20 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-01-26 13:53:20 +0800 |
commit | 401ccb0b9c697fd3af026a72b6621a692e206aea (patch) | |
tree | a516b742fc9228ac826bd167583e8b050cf270f3 /src/gtkutil.c | |
parent | 3e00ab5efb33fd26a38f718d348012e7b718b0a8 (diff) | |
download | emacs-401ccb0b9c697fd3af026a72b6621a692e206aea.tar.gz emacs-401ccb0b9c697fd3af026a72b6621a692e206aea.tar.bz2 emacs-401ccb0b9c697fd3af026a72b6621a692e206aea.zip |
Fix GTK menu bar height reporting when scaled
* src/gtkutil.c (xg_update_frame_menubar): Multiply requisition
height by GDK scale.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 5 |
1 files 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 (); |