summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkpopovermenu.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index afe0ac6089..ef33391408 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -322,19 +322,22 @@ static gboolean
gtk_popover_menu_focus (GtkWidget *widget,
GtkDirectionType direction)
{
+ GtkPopoverMenu *menu = GTK_POPOVER_MENU (widget);
+
if (gtk_widget_get_first_child (widget) == NULL)
{
return FALSE;
}
else
{
- if (GTK_POPOVER_MENU (widget)->open_submenu)
+ if (menu->open_submenu)
{
- if (gtk_widget_child_focus (GTK_POPOVER_MENU (widget)->open_submenu, direction))
+ if (gtk_widget_child_focus (menu->open_submenu, direction))
return TRUE;
if (direction == GTK_DIR_LEFT)
{
- gtk_widget_grab_focus (GTK_POPOVER_MENU (widget)->active_item);
+ gtk_widget_grab_focus (menu->active_item);
+
return TRUE;
}
return FALSE;
@@ -350,7 +353,7 @@ gtk_popover_menu_focus (GtkWidget *widget,
* we eat them.
*/
if (gtk_widget_get_ancestor (widget, GTK_TYPE_POPOVER_MENU_BAR) ||
- (gtk_popover_menu_get_parent_menu (GTK_POPOVER_MENU (widget)) &&
+ (gtk_popover_menu_get_parent_menu (menu) &&
direction == GTK_DIR_LEFT))
return FALSE;
else
@@ -361,7 +364,7 @@ gtk_popover_menu_focus (GtkWidget *widget,
GtkWidget *p;
/* cycle around */
- for (p = gtk_window_get_focus (GTK_WINDOW (gtk_widget_get_root (widget)));
+ for (p = gtk_root_get_focus (gtk_widget_get_root (widget));
p != widget;
p = gtk_widget_get_parent (p))
{