File switch_pane_shortcut.patch of Package thunar

From 25cb31022036663cb60dee9e2199f9c821d20ed6 Mon Sep 17 00:00:00 2001
From: Alexander Schwinn <alexxcons@xfce.org>
Date: Mon, 23 Jan 2023 13:10:56 +0100
Subject: [PATCH] Add Shortcut to switch split-view panes (#1005)

---
 thunar/thunar-window.c | 5 ++++-
 thunar/thunar-window.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 5f0ea5a88..7f91077c9 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -503,6 +503,7 @@ static XfceGtkActionEntry thunar_window_action_entries[] =
     { THUNAR_WINDOW_ACTION_RELOAD,                         "<Actions>/ThunarWindow/reload",                          "<Primary>r",           XFCE_GTK_IMAGE_MENU_ITEM, N_ ("_Reload"),                N_ ("Reload the current folder"),                                                    "view-refresh-symbolic",   G_CALLBACK (thunar_window_action_reload),             },
     { THUNAR_WINDOW_ACTION_RELOAD_ALT,                     "<Actions>/ThunarWindow/reload-alt",                      "F5",                   XFCE_GTK_IMAGE_MENU_ITEM, NULL,                          NULL,                                                                                NULL,                      G_CALLBACK (thunar_window_action_reload),             },
     { THUNAR_WINDOW_ACTION_VIEW_SPLIT,                     "<Actions>/ThunarWindow/toggle-split-view",               "F3",                   XFCE_GTK_CHECK_MENU_ITEM, N_ ("Spl_it View"),            N_ ("Open/Close Split View"),                                                        "view-dual-symbolic",      G_CALLBACK (thunar_window_action_toggle_split_view),  },
+    { THUNAR_WINDOW_ACTION_SWITCH_FOCUSED_SPLIT_VIEW_PANE, "<Actions>/ThunarWindow/switch-focused-split-view-pane",  "",                     XFCE_GTK_MENU_ITEM,       N_ ("Switch Focused Split View Pane"), NULL,                                                                        NULL,                      G_CALLBACK (thunar_window_paned_notebooks_switch),    },
     { THUNAR_WINDOW_ACTION_VIEW_LOCATION_SELECTOR_MENU,    "<Actions>/ThunarWindow/view-location-selector-menu",     "",                     XFCE_GTK_MENU_ITEM,       N_ ("_Location Selector"),     NULL,                                                                                NULL,                      NULL,                                                 },
     { THUNAR_WINDOW_ACTION_VIEW_LOCATION_SELECTOR_ENTRY,   "<Actions>/ThunarWindow/view-location-selector-entry",    "",                     XFCE_GTK_CHECK_MENU_ITEM, N_ ("_Entry Style"),           N_ ("Traditional entry showing the current path"),                                   NULL,                      G_CALLBACK (thunar_window_action_locationbar_entry),  },
     { THUNAR_WINDOW_ACTION_VIEW_LOCATION_SELECTOR_BUTTONS, "<Actions>/ThunarWindow/view-location-selector-buttons",  "",                     XFCE_GTK_CHECK_MENU_ITEM, N_ ("_Buttons Style"),         N_ ("Modern approach with buttons that correspond to folders"),                      NULL,                      G_CALLBACK (thunar_window_action_locationbar_buttons),},
@@ -2709,7 +2710,9 @@ thunar_window_paned_notebooks_switch (ThunarWindow *window)
   GtkWidget *new_curr_notebook = NULL;
 
   _thunar_return_if_fail (THUNAR_IS_WINDOW (window));
-  _thunar_return_if_fail (thunar_window_split_view_is_active (window));
+
+  if (!thunar_window_split_view_is_active (window))
+    return;
 
   if (window->notebook_selected == window->notebook_left)
     new_curr_notebook = window->notebook_right;
diff --git a/thunar/thunar-window.h b/thunar/thunar-window.h
index bce7463d5..588f0e0a9 100644
--- a/thunar/thunar-window.h
+++ b/thunar/thunar-window.h
@@ -56,6 +56,7 @@ typedef enum
   THUNAR_WINDOW_ACTION_RELOAD,
   THUNAR_WINDOW_ACTION_RELOAD_ALT,
   THUNAR_WINDOW_ACTION_VIEW_SPLIT,
+  THUNAR_WINDOW_ACTION_SWITCH_FOCUSED_SPLIT_VIEW_PANE,
   THUNAR_WINDOW_ACTION_VIEW_LOCATION_SELECTOR_MENU,
   THUNAR_WINDOW_ACTION_VIEW_LOCATION_SELECTOR_ENTRY,
   THUNAR_WINDOW_ACTION_VIEW_LOCATION_SELECTOR_BUTTONS,
-- 
GitLab

openSUSE Build Service is sponsored by