Index: gtk/gtkmenu.c =================================================================== --- gtk/gtkmenu.c (revision 17628) +++ gtk/gtkmenu.c (working copy) @@ -2466,7 +2466,8 @@ gtk_menu_paint (GtkWidget *widget, gtk_paint_box (widget->style, widget->window, priv->upper_arrow_state, - GTK_SHADOW_OUT, + priv->upper_arrow_state == GTK_STATE_ACTIVE ? + GTK_SHADOW_IN : GTK_SHADOW_OUT, &event->area, widget, "menu", border_x, border_y, @@ -2490,7 +2491,8 @@ gtk_menu_paint (GtkWidget *widget, gtk_paint_box (widget->style, widget->window, priv->lower_arrow_state, - GTK_SHADOW_OUT, + priv->lower_arrow_state == GTK_STATE_ACTIVE ? + GTK_SHADOW_IN : GTK_SHADOW_OUT, &event->area, widget, "menu", border_x, height - border_y - scroll_arrow_height, @@ -2905,7 +2907,7 @@ gtk_menu_motion_notify (GtkWidget *w if (definitely_within_item (menu_item, event->x, event->y)) menu_shell->activate_time = 0; - + need_enter = (menu->navigation_region != NULL || menu_shell->ignore_enter); /* Check to see if we are within an active submenu's navigation region @@ -3203,26 +3205,34 @@ gtk_menu_handle_scrolling (GtkMenu *menu if (priv->upper_arrow_state != GTK_STATE_INSENSITIVE) { + gboolean arrow_pressed = FALSE; + if (menu->upper_arrow_visible && !menu->tearoff_active) { if (touchscreen_mode) { - if (enter && menu->upper_arrow_prelight && - menu->timeout_id == 0) + if (enter && menu->upper_arrow_prelight) { - /* Deselect the active item so that - * any submenus are popped down - */ - gtk_menu_shell_deselect (menu_shell); - - gtk_menu_remove_scroll_timeout (menu); - menu->scroll_step = -MENU_SCROLL_STEP2; /* always fast */ - - if (!motion) + if (menu->timeout_id == 0) + { + /* Deselect the active item so that + * any submenus are popped down + */ + gtk_menu_shell_deselect (menu_shell); + + gtk_menu_remove_scroll_timeout (menu); + menu->scroll_step = -MENU_SCROLL_STEP2; /* always fast */ + + if (!motion) + { + /* Only do stuff on click. */ + gtk_menu_start_scrolling (menu); + arrow_pressed = TRUE; + } + } + else { - /* Only do stuff on click. */ - gtk_menu_start_scrolling (menu); - priv->upper_arrow_state = GTK_STATE_ACTIVE; + arrow_pressed = TRUE; } gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, @@ -3274,8 +3284,12 @@ gtk_menu_handle_scrolling (GtkMenu *menu } } - priv->upper_arrow_state = menu->upper_arrow_prelight ? - GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; + if (arrow_pressed) + priv->upper_arrow_state = GTK_STATE_ACTIVE; + else if (menu->upper_arrow_prelight) + priv->upper_arrow_state = GTK_STATE_PRELIGHT; + else + priv->upper_arrow_state = GTK_STATE_NORMAL; } /* lower arrow handling */ @@ -3298,26 +3312,34 @@ gtk_menu_handle_scrolling (GtkMenu *menu if (priv->lower_arrow_state != GTK_STATE_INSENSITIVE) { + gboolean arrow_pressed = FALSE; + if (menu->lower_arrow_visible && !menu->tearoff_active) { if (touchscreen_mode) { - if (enter && menu->lower_arrow_prelight && - menu->timeout_id == 0) + if (enter && menu->lower_arrow_prelight) { - /* Deselect the active item so that - * any submenus are popped down - */ - gtk_menu_shell_deselect (menu_shell); - - gtk_menu_remove_scroll_timeout (menu); - menu->scroll_step = MENU_SCROLL_STEP2; /* always fast */ - - if (!motion) + if (menu->timeout_id == 0) { - /* Only do stuff on click. */ - gtk_menu_start_scrolling (menu); - priv->lower_arrow_state = GTK_STATE_ACTIVE; + /* Deselect the active item so that + * any submenus are popped down + */ + gtk_menu_shell_deselect (menu_shell); + + gtk_menu_remove_scroll_timeout (menu); + menu->scroll_step = MENU_SCROLL_STEP2; /* always fast */ + + if (!motion) + { + /* Only do stuff on click. */ + gtk_menu_start_scrolling (menu); + arrow_pressed = TRUE; + } + } + else + { + arrow_pressed = TRUE; } gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, @@ -3369,8 +3391,12 @@ gtk_menu_handle_scrolling (GtkMenu *menu } } - priv->lower_arrow_state = menu->lower_arrow_prelight ? - GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; + if (arrow_pressed) + priv->lower_arrow_state = GTK_STATE_ACTIVE; + else if (menu->lower_arrow_prelight) + priv->lower_arrow_state = GTK_STATE_PRELIGHT; + else + priv->lower_arrow_state = GTK_STATE_NORMAL; } } @@ -4066,13 +4092,13 @@ gtk_menu_scroll_to (GtkMenu *menu, if (offset <= 0) priv->upper_arrow_state = GTK_STATE_INSENSITIVE; - else + else if (priv->upper_arrow_state == GTK_STATE_INSENSITIVE) priv->upper_arrow_state = menu->upper_arrow_prelight ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; if (offset >= menu_height - view_height) priv->lower_arrow_state = GTK_STATE_INSENSITIVE; - else + else if (priv->lower_arrow_state == GTK_STATE_INSENSITIVE) priv->lower_arrow_state = menu->lower_arrow_prelight ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL;