[gtk+] Fix interaction between scrolling menus and automatic mnemonics
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix interaction between scrolling menus and automatic mnemonics
- Date: Sun, 31 Oct 2010 19:57:14 +0000 (UTC)
commit 54a5e37136568db21bcc669a4462ade7b8ee1069
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 31 15:52:32 2010 -0400
Fix interaction between scrolling menus and automatic mnemonics
https://bugzilla.gnome.org/show_bug.cgi?id=612611
gtk/gtkmenu.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 79cb323..743ad5a 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -238,7 +238,8 @@ static void gtk_menu_set_submenu_navigation_region (GtkMenu *menu,
static void gtk_menu_deactivate (GtkMenuShell *menu_shell);
static void gtk_menu_show_all (GtkWidget *widget);
-static void gtk_menu_position (GtkMenu *menu);
+static void gtk_menu_position (GtkMenu *menu,
+ gboolean set_scroll_offset);
static void gtk_menu_reparent (GtkMenu *menu,
GtkWidget *new_parent,
gboolean unrealize);
@@ -1131,7 +1132,7 @@ menu_change_screen (GtkMenu *menu,
if (menu->torn_off)
{
gtk_window_set_screen (GTK_WINDOW (menu->tearoff_window), new_screen);
- gtk_menu_position (menu);
+ gtk_menu_position (menu, TRUE);
}
gtk_window_set_screen (GTK_WINDOW (menu->toplevel), new_screen);
@@ -1618,7 +1619,7 @@ gtk_menu_popup_for_device (GtkMenu *menu,
/* Position the menu, possibly changing the size request
*/
- gtk_menu_position (menu);
+ gtk_menu_position (menu, TRUE);
/* Compute the size of the toplevel and realize it so we
* can scroll correctly.
@@ -2011,7 +2012,7 @@ gtk_menu_reposition (GtkMenu *menu)
g_return_if_fail (GTK_IS_MENU (menu));
if (!menu->torn_off && gtk_widget_is_drawable (GTK_WIDGET (menu)))
- gtk_menu_position (menu);
+ gtk_menu_position (menu, FALSE);
}
static void
@@ -2193,7 +2194,7 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
gtk_menu_set_tearoff_hints (menu, gdk_window_get_width (gtk_widget_get_window (GTK_WIDGET (menu))));
gtk_widget_realize (menu->tearoff_window);
- gtk_menu_position (menu);
+ gtk_menu_position (menu, TRUE);
gtk_widget_show (GTK_WIDGET (menu));
gtk_widget_show (menu->tearoff_window);
@@ -4472,7 +4473,8 @@ gtk_menu_deactivate (GtkMenuShell *menu_shell)
}
static void
-gtk_menu_position (GtkMenu *menu)
+gtk_menu_position (GtkMenu *menu,
+ gboolean set_scroll_offset)
{
GtkWidget *widget;
GtkRequisition requisition;
@@ -4704,7 +4706,8 @@ gtk_menu_position (GtkMenu *menu)
requisition.width, requisition.height);
}
- menu->scroll_offset = scroll_offset;
+ if (set_scroll_offset)
+ menu->scroll_offset = scroll_offset;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]