diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-04-25 11:54:29 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-04-25 11:54:29 -0400 |
commit | 4936e7f85918eb7ae903a9f911af95a000c17656 (patch) | |
tree | 8c887151ba71b784db65e089af232fc486e28361 /gtk/gtkpopovermenu.c | |
parent | 8b64e29ba62ebeadf3130ef740835a2ac8a4992c (diff) | |
download | gtk+-4936e7f85918eb7ae903a9f911af95a000c17656.tar.gz |
Cosmetics
Reduce casting.
Diffstat (limited to 'gtk/gtkpopovermenu.c')
-rw-r--r-- | gtk/gtkpopovermenu.c | 13 |
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)) { |