[gnome-main-menu] bnc#402315 - Make the main-menu fit in small monitors



commit d2a3199c5b28944f58896d35ff00333f866f7b91
Author: Federico Mena Quintero <federico novell com>
Date:   Thu Feb 25 13:33:39 2010 -0600

    bnc#402315 - Make the main-menu fit in small monitors
    
    If the default position of the main-menu window would make it not fit in the monitor's
    area, we would move the menu's window to be aligned with the *other* side of the main-menu button.
    This would cause it to be almost completely outside the screen on small monitors.
    Now we just clamp the position of the window to the monitor's bounds.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 main-menu/src/main-menu-ui.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/main-menu/src/main-menu-ui.c b/main-menu/src/main-menu-ui.c
index 548c49f..dbe7fc7 100644
--- a/main-menu/src/main-menu-ui.c
+++ b/main-menu/src/main-menu-ui.c
@@ -2169,11 +2169,11 @@ slab_window_allocate_cb (GtkWidget *widget, GtkAllocation *alloc, gpointer user_
 
 	if (orient == PANEL_APPLET_ORIENT_UP || orient == PANEL_APPLET_ORIENT_DOWN) {
 		if ((slab_geom.x + slab_geom.width) > (monitor_geom.x + monitor_geom.width))
-			slab_geom.x = button_geom.x + button_geom.width - slab_geom.width;
+			slab_geom.x = MAX (monitor_geom.x, monitor_geom.x + monitor_geom.width - slab_geom.width);
 	}
 	else {
 		if ((slab_geom.y + slab_geom.height) > (monitor_geom.y + monitor_geom.height))
-			slab_geom.y = button_geom.y + button_geom.height - slab_geom.height;
+			slab_geom.y = MAX (monitor_geom.y, monitor_geom.y + monitor_geom.height - slab_geom.height);
 	}
 
 	gtk_window_move (GTK_WINDOW (priv->slab_window), slab_geom.x, slab_geom.y);



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