[libhandy] tab-view: Only consume Alt+[0-9] if it's not the selected tab



commit e565d167136d7dfa1f682118d324de9533c7a4ae
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Mon Dec 13 11:15:59 2021 +0100

    tab-view: Only consume Alt+[0-9] if it's not the selected tab
    
    This fixes e.g. pressing Alt+1 in kgx reaching the terminal application,
    when there are only one open tab.

 src/hdy-tab-view.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/hdy-tab-view.c b/src/hdy-tab-view.c
index 4a5c85cf..c69f8e6b 100644
--- a/src/hdy-tab-view.c
+++ b/src/hdy-tab-view.c
@@ -958,6 +958,9 @@ shortcut_key_press_cb (HdyTabView  *self,
         return GDK_EVENT_PROPAGATE;
 
       page = hdy_tab_view_get_nth_page (self, n_page);
+      if (hdy_tab_view_get_selected_page (self) == page)
+        return GDK_EVENT_PROPAGATE;
+
       hdy_tab_view_set_selected_page (self, page);
 
       return GDK_EVENT_STOP;


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