Commit 695ff388 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels Committed by Matthias Clasen

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
parent e9c43133
......@@ -3347,6 +3347,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);
......@@ -3356,10 +3357,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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment