代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gnome-console 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 41f0321b2ee83e1bd670177e5960c4d5dcbb281f Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Mon, 28 Mar 2022 23:16:26 -0700
Subject: [PATCH] Enable Ctrl+PgUp/PgDn to switch tabs if there are multiple
tabs
Users expect Ctrl+PgUp/PgDn to switch tabs, but some terminal
applications want to be able to use these keys themselves. Make the
same compromise that gnome-terminal does, and let these keys switch
tabs _if_ there are multiple tabs in the current window to switch
between.
Fixes https://gitlab.gnome.org/GNOME/console/-/issues/118.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
src/kgx-pages.c | 19 +++++++++++++++++++
src/kgx-pages.h | 1 +
src/kgx-window.c | 9 +++++----
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/src/kgx-pages.c b/src/kgx-pages.c
index 0b7c37a..4084efd 100644
--- a/src/kgx-pages.c
+++ b/src/kgx-pages.c
@@ -819,6 +819,25 @@ kgx_pages_current_status (KgxPages *self)
}
+/**
+ * kgx_pages_count:
+ * @self: the #KgxPages
+ *
+ * Returns: number of #KgxTab s in @self
+ */
+int
+kgx_pages_count (KgxPages *self)
+{
+ KgxPagesPrivate *priv;
+
+ g_return_val_if_fail (KGX_IS_PAGES (self), KGX_NONE);
+
+ priv = kgx_pages_get_instance_private (self);
+
+ return hdy_tab_view_get_n_pages (HDY_TAB_VIEW (priv->view));
+}
+
+
/**
* kgx_pages_get_children:
* @self: the #KgxPages
diff --git a/src/kgx-pages.h b/src/kgx-pages.h
index 9fbaae6..9a03c77 100644
--- a/src/kgx-pages.h
+++ b/src/kgx-pages.h
@@ -45,6 +45,7 @@ void kgx_pages_add_page (KgxPages *self,
KgxTab *page);
void kgx_pages_remove_page (KgxPages *self,
KgxTab *page);
+int kgx_pages_count (KgxPages *self);
GPtrArray *kgx_pages_get_children (KgxPages *self);
void kgx_pages_focus_page (KgxPages *self,
KgxTab *page);
diff --git a/src/kgx-window.c b/src/kgx-window.c
index acddf60..3bc1d0c 100644
--- a/src/kgx-window.c
+++ b/src/kgx-window.c
@@ -260,10 +260,11 @@ key_press_event (GtkWidget *widget,
*
* See https://gitlab.gnome.org/GNOME/libhandy/-/issues/422
*/
- if ((keyval == GDK_KEY_Page_Up ||
- keyval == GDK_KEY_KP_Page_Up ||
- keyval == GDK_KEY_Page_Down ||
- keyval == GDK_KEY_KP_Page_Down ||
+ if ((((keyval == GDK_KEY_Page_Up ||
+ keyval == GDK_KEY_KP_Page_Up ||
+ keyval == GDK_KEY_Page_Down ||
+ keyval == GDK_KEY_KP_Page_Down) &&
+ kgx_pages_count (KGX_PAGES (self->pages)) <= 1) ||
keyval == GDK_KEY_Home ||
keyval == GDK_KEY_KP_Home ||
keyval == GDK_KEY_End ||
--
2.35.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。