[totem] main: Make XF86Back go back up a level in library



commit 0f1f06b9a1bb8882ade3f6e8a9f9b158dc409b67
Author: ignapk <automat script gmail com>
Date:   Fri Sep 18 05:32:27 2020 +0200

    main: Make XF86Back go back up a level in library
    
    Currently XF86Back key triggers the same action as XF86AudioPrev, which
    is seeking previous media in current playlist.
    
    In other GNOME apps like epiphany and nautilus XF86Back is used to
    navigate back in the UI, which makes totem behaviour inconsistent.
    On the other hand, totem doesn't have a strong spatial navigation
    between sections so navigating the playlist is more useful than between
    pages.
    
    With that in mind, make it possible to use XF86Back to go back up a
    level when in the library.
    
    Fixes https://gitlab.gnome.org/GNOME/totem/-/issues/367

 src/totem-object.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 2cc2fe018..7b945eb6a 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3591,8 +3591,13 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
        }
 
        /* Check whether we're in the player panel */
-       if (!g_str_equal (totem_object_get_main_page (totem), "player"))
+       if (!g_str_equal (totem_object_get_main_page (totem), "player")) {
+               if (event->type == GDK_KEY_PRESS &&
+                   event->keyval == GDK_KEY_Back &&
+                   totem_grilo_get_show_back_button (TOTEM_GRILO (totem->grilo)))
+                       back_button_clicked_cb (NULL, totem);
                return FALSE;
+       }
 
        /* Special case Eject, Open, Open URI,
         * seeking and zoom keyboard shortcuts */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]