diff --git a/thunar/thunar-history-action.c b/thunar/thunar-history-action.c
index 30e451c632ef694180debd6c684af0d92d5a249d..5f2baab5e13e397662ec0ba7c959e1f2aa075daa 100644
--- a/thunar/thunar-history-action.c
+++ b/thunar/thunar-history-action.c
@@ -260,7 +260,7 @@ thunar_history_action_create_tool_item (GtkAction *action)
   gtk_container_add (GTK_CONTAINER (tool_item), button);
   gtk_button_set_relief (GTK_BUTTON (button),
       gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (tool_item)));
-  gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+  gtk_widget_set_focus_on_click (button, FALSE);
   gtk_widget_show (button);
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 197ab8b697ba436a1e43e11ef71b781b019f5127..25ff9cd23c4c23ad05514fe3208632d375c4b133 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -1827,7 +1827,7 @@ thunar_window_notebook_insert (ThunarWindow *window,
   button = gtk_button_new ();
   gtk_box_pack_start (GTK_BOX (label_box), button, FALSE, FALSE, 0);
   gtk_widget_set_can_default (button, FALSE);
-  gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+  gtk_widget_set_focus_on_click (button, FALSE);
   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
   gtk_widget_set_tooltip_text (button, _("Close tab"));
   g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), view);