[gtk+/gtk-3-14] gtkmenu: fix unnecessary scroll buttons
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] gtkmenu: fix unnecessary scroll buttons
- Date: Wed, 5 Nov 2014 22:05:55 +0000 (UTC)
commit 695ff3882b8955417021824467914d9200bf6e1a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Oct 31 03:10:13 2014 +0200
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 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 490948d..2f8eabf 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]