!84 发布v2.6版本

From: @niko_yhc 
Reviewed-by: @liubuguiii 
Signed-off-by: @liubuguiii
This commit is contained in:
openeuler-ci-bot 2024-01-18 03:29:43 +00:00 committed by Gitee
commit 755a3df853
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 6 additions and 437 deletions

View File

@ -1,31 +0,0 @@
From f5d0a115fa44bd1a3a61b2a109956a15130e11e4 Mon Sep 17 00:00:00 2001
From: huangjiawen <huangjiawen@kylinsec.com.cn>
Date: Tue, 27 Jun 2023 18:51:42 +0800
Subject: [PATCH] fix(coredump): Fix crash when clicking on the power option
button in vnc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复在vnc下点击电源选项按钮崩溃
Signed-off-by: huangjiawen <huangjiawen@kylinsec.com.cn>
---
src/common/kiran-power.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/common/kiran-power.cpp b/src/common/kiran-power.cpp
index 9ef8a2c..8485a9f 100644
--- a/src/common/kiran-power.cpp
+++ b/src/common/kiran-power.cpp
@@ -366,6 +366,7 @@ bool KiranPower::can_logout()
bool KiranPower::can_switch_user()
{
RETURN_VAL_IF_TRUE(this->settings_->get_boolean(STARTMENU_LOCKDOWN_KEY_DISABLE_USER_SWITCHING), false);
+ RETURN_VAL_IF_FALSE(this->seat_manager_proxy_, false);
try
{
--
2.33.0

View File

@ -1,51 +0,0 @@
From 2724de097ff51a06e28579066a5085d5318a7b0e Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Thu, 24 Aug 2023 14:37:03 +0800
Subject: [PATCH] fix(tray):Place all tray icons in the panel and no longer in
the tray container for the time being
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将所有托盘图标都放到面板中,暂时不再放入托盘容器中
Related #12490
---
src/tray/kiran-tray.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/tray/kiran-tray.c b/src/tray/kiran-tray.c
index 9b40d96..2d5d418 100644
--- a/src/tray/kiran-tray.c
+++ b/src/tray/kiran-tray.c
@@ -1123,7 +1123,7 @@ kiran_tray_notify_icon_added(KiranTrayManager *manager,
priv = tray->priv;
id = kiran_notify_icon_get_id(icon);
- type = kiran_tray_get_icon_type(priv->settings, id);
+ // type = kiran_tray_get_icon_type(priv->settings, id);
/* 系统已知的通知图标如声音,网络,电池等不需要记录 */
if (kiran_notify_icon_get_category(icon) != KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE)
@@ -1136,6 +1136,10 @@ kiran_tray_notify_icon_added(KiranTrayManager *manager,
gtk_widget_set_name(GTK_WIDGET(icon), "iconWinButton");
+ gtk_box_pack_start(GTK_BOX(tray), GTK_WIDGET(icon), FALSE, TRUE, 0);
+ kiran_tray_icons_refresh(tray);
+
+ /*
if (type == ICON_SHOW_IN_PANEL)
{
gtk_box_pack_start(GTK_BOX(tray), GTK_WIDGET(icon), FALSE, TRUE, 0);
@@ -1149,6 +1153,7 @@ kiran_tray_notify_icon_added(KiranTrayManager *manager,
gtk_widget_show(priv->icons_win_button);
position_notify_icon_window(tray, FALSE);
}
+ */
g_signal_connect(icon,
"size-allocate",
--
2.33.0

View File

@ -1,69 +0,0 @@
From 4428d8c315ac13d8bacc533a9b6cc64bf335d30b Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Wed, 30 Aug 2023 17:04:12 +0800
Subject: [PATCH] fix(tray):Fixed a crash issue that occurred when the tray
icon was removed from the tray area
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复托盘图标从托盘区域移除时,发生的崩溃问题
Related #14004
---
src/tray/kiran-tray.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/tray/kiran-tray.c b/src/tray/kiran-tray.c
index 2d5d418..4093571 100644
--- a/src/tray/kiran-tray.c
+++ b/src/tray/kiran-tray.c
@@ -1123,7 +1123,7 @@ kiran_tray_notify_icon_added(KiranTrayManager *manager,
priv = tray->priv;
id = kiran_notify_icon_get_id(icon);
- // type = kiran_tray_get_icon_type(priv->settings, id);
+ type = kiran_tray_get_icon_type(priv->settings, id);
/* 系统已知的通知图标如声音,网络,电池等不需要记录 */
if (kiran_notify_icon_get_category(icon) != KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE)
@@ -1136,9 +1136,12 @@ kiran_tray_notify_icon_added(KiranTrayManager *manager,
gtk_widget_set_name(GTK_WIDGET(icon), "iconWinButton");
- gtk_box_pack_start(GTK_BOX(tray), GTK_WIDGET(icon), FALSE, TRUE, 0);
- kiran_tray_icons_refresh(tray);
-
+ if (type != ICON_NOT_SHOW)
+ {
+ gtk_box_pack_start(GTK_BOX(tray), GTK_WIDGET(icon), FALSE, TRUE, 0);
+ kiran_tray_icons_refresh(tray);
+ }
+
/*
if (type == ICON_SHOW_IN_PANEL)
{
@@ -1186,6 +1189,12 @@ kiran_tray_notify_icon_removed(KiranTrayManager *manager,
id = kiran_notify_icon_get_id(icon);
type = kiran_tray_get_icon_type(priv->settings, id);
+ if(type != ICON_NOT_SHOW)
+ {
+ gtk_container_remove(GTK_CONTAINER(tray), GTK_WIDGET(icon));
+ }
+
+ /*
if (type == ICON_SHOW_IN_PANEL)
{
gtk_container_remove(GTK_CONTAINER(tray), GTK_WIDGET(icon));
@@ -1203,6 +1212,7 @@ kiran_tray_notify_icon_removed(KiranTrayManager *manager,
position_notify_icon_window(tray, FALSE);
}
+ */
priv->icons = g_slist_remove(priv->icons, icon);
}
--
2.33.0

View File

@ -1,188 +0,0 @@
From c7bc43571acc57546cd732e3658be86d308f0256 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Thu, 14 Sep 2023 17:34:29 +0800
Subject: [PATCH] feature(sn-icon-menu):Support dynamic increase or decrease of
sub-item MenuItem in the tray right-click menu and property changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 支持托盘右键菜单中的子项MenuItem动态增减以及属性变化
Closed #15944
---
src/tray/kiran-sn-icon-menu.c | 126 +++++++++++++++++++++++++++++-----
1 file changed, 109 insertions(+), 17 deletions(-)
diff --git a/src/tray/kiran-sn-icon-menu.c b/src/tray/kiran-sn-icon-menu.c
index 22e321f..ffae1bb 100644
--- a/src/tray/kiran-sn-icon-menu.c
+++ b/src/tray/kiran-sn-icon-menu.c
@@ -1,19 +1,20 @@
/**
- * Copyright (c) 2020 ~ 2021 KylinSec Co., Ltd.
+ * Copyright (c) 2020 ~ 2021 KylinSec Co., Ltd.
* kiran-cc-daemon is licensed under Mulan PSL v2.
- * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
- * http://license.coscl.org.cn/MulanPSL2
- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
- * See the Mulan PSL v2 for more details.
- *
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
* Author: wangxiaoqing <wangxiaoqing@kylinos.com.cn>
*/
#include "kiran-sn-icon-menu.h"
#include <libdbusmenu-glib/dbusmenu-glib.h>
+#include <libdbusmenu-glib/menuitem.h>
struct _KiranSnIconMenuPrivate
{
gchar *bus_name;
@@ -30,6 +31,7 @@ enum
LAST_PROP
};
+#define DATA_KEY_SIGNAL_PROPERTY_CHANGED_IS_CONNECTED "signal_property_changed_is_connected"
static GParamSpec *properties[LAST_PROP] = {NULL};
G_DEFINE_TYPE_WITH_PRIVATE(KiranSnIconMenu, kiran_sn_icon_menu, GTK_TYPE_MENU)
@@ -175,6 +177,88 @@ create_widget_from_menuitem(DbusmenuMenuitem *item)
return gmi;
}
+static void
+kiran_sn_icon_menu_create_widget_from_dbusmenuitem(KiranSnIconMenu *menu, DbusmenuMenuitem *item)
+{
+ GtkWidget *gmi = create_widget_from_menuitem(item);
+
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gmi);
+ gtk_widget_show(gmi);
+
+ g_signal_connect(gmi,
+ "activate",
+ G_CALLBACK(activate_cb),
+ item);
+}
+
+static void
+kiran_sn_icon_menu_remove_widget_all(KiranSnIconMenu *menu)
+{
+ GList *child;
+ GList *container_children = gtk_container_get_children(GTK_CONTAINER(menu));
+ for (child = container_children; child; child = child->next)
+ {
+ gtk_container_remove(GTK_CONTAINER(menu), GTK_WIDGET(child->data));
+ gtk_widget_destroy(GTK_WIDGET(child->data));
+ }
+}
+
+static void
+property_changed_cb(DbusmenuMenuitem *item, gchar *property, GVariant *value, gpointer user_data)
+{
+ GList *child;
+ KiranSnIconMenu *menu = KIRAN_SN_ICON_MENU(user_data);
+
+ kiran_sn_icon_menu_remove_widget_all(menu);
+
+ // 遍历MenuItem以找到root
+ DbusmenuMenuitem *root = dbusmenu_menuitem_get_parent(item);
+ gboolean is_root = dbusmenu_menuitem_get_root(root);
+
+ while (!is_root)
+ {
+ root = dbusmenu_menuitem_get_parent(root);
+ is_root = dbusmenu_menuitem_get_root(root);
+ }
+
+ GList *dbus_menuitem_children = dbusmenu_menuitem_get_children(root);
+ for (child = dbus_menuitem_children; child; child = child->next)
+ {
+ kiran_sn_icon_menu_create_widget_from_dbusmenuitem(menu,child->data);
+ }
+}
+
+static void
+submenu_get_children_to_connect(DbusmenuMenuitem *submenu, gpointer user_data)
+{
+ KiranSnIconMenu *menu = KIRAN_SN_ICON_MENU(user_data);
+ GList *submenu_children = dbusmenu_menuitem_get_children(submenu);
+ GList *submenu_child;
+ for (submenu_child = submenu_children; submenu_child; submenu_child = submenu_child->next)
+ {
+ const gchar *children_display = dbusmenu_menuitem_property_get(submenu_child->data, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY);
+ if (g_strcmp0(children_display, "submenu") == 0)
+ {
+ submenu_get_children_to_connect(submenu_child->data, menu);
+ }
+
+ gboolean is_connected = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(submenu_child->data), DATA_KEY_SIGNAL_PROPERTY_CHANGED_IS_CONNECTED));
+ if (!is_connected)
+ {
+ g_signal_connect(submenu_child->data, DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(property_changed_cb), menu);
+ g_object_set_data(G_OBJECT(submenu_child->data), DATA_KEY_SIGNAL_PROPERTY_CHANGED_IS_CONNECTED, GINT_TO_POINTER(TRUE));
+ }
+ }
+}
+
+/**
+ * NOTE:
+ * dbus_menuitem 移除某个menuitem时没有类似REMOVE_MENUITEM的信号
+ * 而是会触发 DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED 信号。
+ * 新增时会触发 DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM 信号
+ *
+ * 因此layout_updated_cb中还会处理menuitem变化的情况
+ */
static void
layout_updated_cb(DbusmenuClient *client,
gpointer user_data)
@@ -182,21 +266,29 @@ layout_updated_cb(DbusmenuClient *client,
KiranSnIconMenu *menu;
DbusmenuMenuitem *root = dbusmenu_client_get_root(client);
GList *child;
- GList *children = dbusmenu_menuitem_get_children(root);
menu = KIRAN_SN_ICON_MENU(user_data);
- for (child = children; child; child = child->next)
+ kiran_sn_icon_menu_remove_widget_all(menu);
+
+ GList *dbus_menuitem_children = dbusmenu_menuitem_get_children(root);
+ for (child = dbus_menuitem_children; child; child = child->next)
{
- GtkWidget *gmi = create_widget_from_menuitem(child->data);
+ kiran_sn_icon_menu_create_widget_from_dbusmenuitem(menu,child->data);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), gmi);
- gtk_widget_show(gmi);
+ // NOTE:只修改一个属性,可能会触发多个 PROPERTY_CHANGE 信号
+ const gchar *children_display = dbusmenu_menuitem_property_get(child->data, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY);
+ if (g_strcmp0(children_display, "submenu") == 0)
+ {
+ submenu_get_children_to_connect(child->data, menu);
+ }
- g_signal_connect(gmi,
- "activate",
- G_CALLBACK(activate_cb),
- child->data);
+ gboolean is_connected = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(child->data), DATA_KEY_SIGNAL_PROPERTY_CHANGED_IS_CONNECTED));
+ if (!is_connected)
+ {
+ g_signal_connect(child->data, DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(property_changed_cb), menu);
+ g_object_set_data(G_OBJECT(child->data), DATA_KEY_SIGNAL_PROPERTY_CHANGED_IS_CONNECTED, GINT_TO_POINTER(TRUE));
+ }
}
}
--
2.33.0

View File

@ -1,32 +0,0 @@
From b0137c26ea84240a80c693650c5c70ec81323a52 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Sun, 8 Oct 2023 09:49:05 +0800
Subject: [PATCH 1/2] fix(sn-icon):Fixed case where kiran_sn_icon_context_menu
was not called when Menu was not set by tray program
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复当托盘程序未设置Menu时未调用kiran_sn_icon_context_menu的情况
Close #17216
---
src/tray/kiran-sn-icon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tray/kiran-sn-icon.c b/src/tray/kiran-sn-icon.c
index a36040d..0309ee4 100644
--- a/src/tray/kiran-sn-icon.c
+++ b/src/tray/kiran-sn-icon.c
@@ -1230,7 +1230,7 @@ kiran_sn_icon_button_press_event(GtkWidget *widget,
}
else if (event->button == 3)
{
- if (priv->gmenu != NULL)
+ if ((g_strcmp0(priv->menu, "/NO_DBUSMENU") != 0) && priv->gmenu != NULL)
{
gtk_menu_popup_at_widget(priv->gmenu, widget,
GDK_GRAVITY_SOUTH_WEST,
--
2.33.0

View File

@ -1,45 +0,0 @@
From 195fec91ec7d9019ae14a56b649caeaca434c826 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Sun, 8 Oct 2023 10:09:00 +0800
Subject: [PATCH 2/2] fix(sn-icon-menu):Fixed an issue where the menuItem
property was still visible after being set to invisible
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复menuItem属性设置为不可见后但仍然可见的问题
---
src/tray/kiran-sn-icon-menu.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/tray/kiran-sn-icon-menu.c b/src/tray/kiran-sn-icon-menu.c
index ffae1bb..02333f3 100644
--- a/src/tray/kiran-sn-icon-menu.c
+++ b/src/tray/kiran-sn-icon-menu.c
@@ -138,7 +138,6 @@ create_widget_from_menuitem(DbusmenuMenuitem *item)
GtkWidget *gmi = create_widget_from_menuitem(child->data);
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), gmi);
- gtk_widget_show(gmi);
g_signal_connect(gmi,
"activate",
@@ -146,7 +145,6 @@ create_widget_from_menuitem(DbusmenuMenuitem *item)
child->data);
}
- gtk_widget_show(submenu);
}
if (toggle_state != DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN &&
@@ -183,7 +181,6 @@ kiran_sn_icon_menu_create_widget_from_dbusmenuitem(KiranSnIconMenu *menu, Dbusme
GtkWidget *gmi = create_widget_from_menuitem(item);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), gmi);
- gtk_widget_show(gmi);
g_signal_connect(gmi,
"activate",
--
2.33.0

Binary file not shown.

BIN
kiran-menu-2.6.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,18 +1,11 @@
Name: kiran-menu
Version: 2.5.1
Release: 5
Version: 2.6.0
Release: 1%{?dist}.kb1
Summary: Applets for mate panel from Kiran Desktop
License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-fix-coredump-Fix-crash-when-clicking-on-the-power-op.patch
Patch0002: 0002-fix-tray-Place-all-tray-icons-in-the-panel-and-no-lo.patch
Patch0003: 0003-fix-tray-Fixed-a-crash-issue-that-occurred-when-the-.patch
Patch0004: 0004-feature-sn-icon-menu-Support-dynamic-increase-or-dec.patch
Patch0005: 0005-fix-sn-icon-Fixed-case-where-kiran_sn_icon_context_m.patch
Patch0006: 0006-fix-sn-icon-menu-Fixed-an-issue-where-the-menuItem-p.patch
BuildRequires: cmake > 3.0
BuildRequires: gcc-c++
BuildRequires: gtkmm30-devel
@ -103,19 +96,11 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
%changelog
* Fri Sep 15 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.1-5
- KYOS-F: Fixed case where kiran_sn_icon_context_menu was not called when Menu was not set by tray program (#17216)
- KYOS-F: Fixed an issue where the menuItem property was still visible after being set to invisible
* Wed Dec 06 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.6.0-1.kb1
- release 2.6,new start menu icon
* Fri Sep 15 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.1-4
- KYOS-F: Support dynamic increase or decrease of sub-item MenuItem in the tray right-click menu and property changes (#15944)
* Fri Sep 01 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.1-3
- KYOS-F: Place all tray icons in the panel and no longer in the tray container for the time being (#12490)
- KYOS-F: Fixed a crash issue that occurred when the tray icon was removed from the tray area (#14004)
* Fri Jun 30 2023 huangjiawen <huangjiawen@kylinsec.com.cn> - 2.5.1-2
- KYOS-F: Fix crash when clicking on the power option button in vnc.
* Thu May 11 2023 kpkg <kpkg.kylinsec.com.cn> - 2.5.1-1.kb1
- rebuild for KiranUI-2.5-next
* Wed May 10 2023 tangjie02 <tangjie02@kylinsec.com.cn> - 2.5.1-1
- KYOS-F: replace suspend/hibernate/shutdown api with SessionManager.