[libadwaita] tab-view: Propagate Alt-[0-9] if selected tab doesn't change



commit 591d80520d735cf391c65c74ed122886a8ee15f0
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Mon Dec 13 11:33:50 2021 +0100

    tab-view: Propagate Alt-[0-9] if selected tab doesn't change
    
    This makes it possible to consume the Alt-[0-9] event inside the tab
    view if the tab view wouldn't change. This is needed in the future when
    vte/kgx gets ported to gtk4/libadwaita to not consume events intended
    for terminal applications.

 src/adw-tab-view.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/adw-tab-view.c b/src/adw-tab-view.c
index e38d37ca..18050baf 100644
--- a/src/adw-tab-view.c
+++ b/src/adw-tab-view.c
@@ -1198,6 +1198,9 @@ select_nth_page_cb (GtkWidget  *widget,
     return GDK_EVENT_PROPAGATE;
 
   page = adw_tab_view_get_nth_page (self, n_page);
+  if (adw_tab_view_get_selected_page (self) == page)
+    return GDK_EVENT_PROPAGATE;
+
   adw_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]