summaryrefslogtreecommitdiff
path: root/gtk/gtkpaned.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-03-02 08:49:00 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-03-16 21:24:44 -0400
commit2bf1561b48ee02f340515e6a3e08bc08d89b5f18 (patch)
treeabf1a100d133a1e7077cc0898dbe778205f6e4f5 /gtk/gtkpaned.c
parentbd44831987381a6e790c6703ab68b443e89cb727 (diff)
downloadgtk+-2bf1561b48ee02f340515e6a3e08bc08d89b5f18.tar.gz
Port widgets to the root focus API
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r--gtk/gtkpaned.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 9fc18c9667..c09b3d9142 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -2256,10 +2256,8 @@ gtk_paned_restore_focus (GtkPaned *paned)
if (!gtk_widget_child_focus (GTK_WIDGET (paned), GTK_DIR_TAB_FORWARD))
{
- GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (paned));
-
- if (GTK_IS_WINDOW (toplevel))
- gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
+ GtkRoot *root = gtk_widget_get_root (GTK_WIDGET (paned));
+ gtk_root_set_focus (root, NULL);
}
}
@@ -2364,7 +2362,6 @@ gtk_paned_cycle_handle_focus (GtkPaned *paned,
{
GtkPaned *focus;
GtkPaned *first;
- GtkWidget *toplevel;
GtkWidget *focus_child;
gtk_paned_find_neighbours (paned, &next, &prev);
@@ -2410,10 +2407,7 @@ gtk_paned_cycle_handle_focus (GtkPaned *paned,
first = next;
}
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (paned));
-
- if (GTK_IS_WINDOW (toplevel))
- gtk_paned_set_saved_focus (focus, gtk_window_get_focus (GTK_WINDOW (toplevel)));
+ gtk_paned_set_saved_focus (focus, gtk_root_get_focus (gtk_widget_get_root (GTK_WIDGET (paned))));
gtk_paned_set_first_paned (focus, first);
priv->original_position = gtk_paned_get_position (focus);