From bdaef1f88d44ca26a522314514d29d52e40fea87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Fri, 31 Oct 2014 03:10:13 +0200 Subject: [PATCH] gtkmenu: fix unnecessary scroll buttons Don't change menu height if menu is out of monitor only by shadow width. https://bugzilla.gnome.org/show_bug.cgi?id=738321 --- gtk/gtkmenu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 1dab98c59f..6862ca994e 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -3339,6 +3339,7 @@ gtk_menu_get_preferred_height_for_width (GtkWidget *widget, { GdkScreen *screen = gtk_widget_get_screen (priv->toplevel); GdkRectangle monitor; + GtkBorder border; gdk_screen_get_monitor_workarea (screen, priv->monitor_num, &monitor); @@ -3348,10 +3349,12 @@ gtk_menu_get_preferred_height_for_width (GtkWidget *widget, if (priv->position_y + nat_height > monitor.y + monitor.height) nat_height = monitor.y + monitor.height - priv->position_y; - if (priv->position_y < monitor.y) + _gtk_window_get_shadow_width (GTK_WINDOW (priv->toplevel), &border); + + if (priv->position_y + border.top < monitor.y) { - min_height -= monitor.y - priv->position_y; - nat_height -= monitor.y - priv->position_y; + min_height -= monitor.y - (priv->position_y + border.top); + nat_height -= monitor.y - (priv->position_y + border.top); } }