[gtk+] Only push the menu in if the position function said so



commit f1bfdda3fd9275f1527a19a0d19409fdec16f587
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 23 04:44:17 2011 +0000

    Only push the menu in if the position function said so

 gtk/gtkmenu.c |   15 ++-------------
 1 files changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 1f0fb37..652aa9a 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -4796,10 +4796,9 @@ gtk_menu_position (GtkMenu  *menu,
           scroll_offset += monitor.y - y;
           y = monitor.y;
         }
-    }
 
-  /* FIXME: should this be done in the various position_funcs ? */
-  x = CLAMP (x, monitor.x, MAX (monitor.x, monitor.x + monitor.width - requisition.width));
+      x = CLAMP (x, monitor.x, MAX (monitor.x, monitor.x + monitor.width - requisition.width));
+    }
 
   if (GTK_MENU_SHELL (menu)->priv->active)
     {
@@ -4808,16 +4807,6 @@ gtk_menu_position (GtkMenu  *menu,
       priv->position_y = y;
     }
 
-  if (y + requisition.height > monitor.y + monitor.height)
-    requisition.height = (monitor.y + monitor.height) - y;
-
-  if (y < monitor.y)
-    {
-      scroll_offset += monitor.y - y;
-      requisition.height -= monitor.y - y;
-      y = monitor.y;
-    }
-
   if (scroll_offset > 0)
     {
       GtkBorder arrow_border;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]