[gnome-panel] panel: Do not use a custom position for Edit menu of objects



commit 36ae32d34ee09f4ca2d78365de6fed5210586ece
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Feb 22 19:41:21 2011 +0100

    panel: Do not use a custom position for Edit menu of objects
    
    Using the default positioning algorithm makes the difference between the
    two menus more visible.

 gnome-panel/applet.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 62a2d6a..80d4dba 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -726,6 +726,7 @@ panel_applet_position_menu (GtkMenu   *menu,
 static void
 applet_show_menu (AppletInfo     *info,
 		  GtkWidget      *menu,
+		  gboolean        custom_position,
 		  GdkEventButton *event)
 {
 	PanelWidget *panel_widget;
@@ -750,7 +751,8 @@ applet_show_menu (AppletInfo     *info,
 	gtk_menu_popup (GTK_MENU (menu),
 			NULL,
 			NULL,
-			(GtkMenuPositionFunc) panel_applet_position_menu,
+			custom_position ?
+				(GtkMenuPositionFunc) panel_applet_position_menu : NULL,
 			info->widget,
 			event->button,
 			event->time);
@@ -784,9 +786,9 @@ applet_button_press (GtkWidget      *widget,
 	modifiers = event->state & GDK_MODIFIER_MASK;
 
 	if (modifiers == panel_bindings_get_mouse_button_modifier_keymask ())
-		applet_show_menu (info, panel_applet_get_edit_menu (info), event);
+		applet_show_menu (info, panel_applet_get_edit_menu (info), FALSE, event);
 	else
-		applet_show_menu (info, panel_applet_get_menu (info), event);
+		applet_show_menu (info, panel_applet_get_menu (info), TRUE, event);
 
 	return TRUE;
 }
@@ -839,11 +841,11 @@ applet_key_press (GtkWidget   *widget,
 			break;
 	}
 
-	if (is_popup)
-		applet_show_menu (info, panel_applet_get_menu (info), &eventbutton);
-
 	if (is_edit_popup)
-		applet_show_menu (info, panel_applet_get_edit_menu (info), &eventbutton);
+		applet_show_menu (info, panel_applet_get_edit_menu (info), FALSE, &eventbutton);
+
+	if (is_popup)
+		applet_show_menu (info, panel_applet_get_menu (info), TRUE, &eventbutton);
 
 	return (is_popup || is_edit_popup);
 }



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