From 85cad4f0d49709dd2eaacb2931b2c16025aa77f6 Mon Sep 17 00:00:00 2001
From: Alexander Schwinn <alexxcons@xfce.org>
Date: Sun, 16 Apr 2023 11:06:00 +0200
Subject: [PATCH] Use new window for history signal handler (#1073)

(cherry picked from commit 46fb55df31767032ea82fdff567e3a3632c2c12f)
---
 thunar/thunar-window.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index f9d4770e7..1fa286501 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -3414,15 +3414,15 @@ thunar_window_action_open_new_window (ThunarWindow *window,
       thunar_standard_view_set_history (THUNAR_STANDARD_VIEW (new_window->view), history);
       thunar_window_history_changed (new_window);
 
-      /* connect to the new history */
-      window->signal_handler_id_history_changed = g_signal_connect_swapped (G_OBJECT (history), "history-changed", G_CALLBACK (thunar_window_history_changed), new_window);
+      /* connect the new window to the new history */
+      new_window->signal_handler_id_history_changed = g_signal_connect_swapped (G_OBJECT (history), "history-changed", G_CALLBACK (thunar_window_history_changed), new_window);
     }
 
   /* determine the first visible file in the current window */
   if (thunar_view_get_visible_range (THUNAR_VIEW (window->view), &start_file, NULL))
     {
       /* scroll the new window to the same file */
-      thunar_view_scroll_to_file (THUNAR_VIEW (window->view), start_file, FALSE, TRUE, 0.1f, 0.1f);
+      thunar_view_scroll_to_file (THUNAR_VIEW (new_window->view), start_file, FALSE, TRUE, 0.1f, 0.1f);
 
       /* release the file reference */
       g_object_unref (G_OBJECT (start_file));
-- 
GitLab