diff --git a/0002-fix-tray-Place-all-tray-icons-in-the-panel-and-no-lo.patch b/0002-fix-tray-Place-all-tray-icons-in-the-panel-and-no-lo.patch new file mode 100644 index 0000000..89555bf --- /dev/null +++ b/0002-fix-tray-Place-all-tray-icons-in-the-panel-and-no-lo.patch @@ -0,0 +1,51 @@ +From 2724de097ff51a06e28579066a5085d5318a7b0e Mon Sep 17 00:00:00 2001 +From: luoqing +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 + diff --git a/0003-fix-tray-Fixed-a-crash-issue-that-occurred-when-the-.patch b/0003-fix-tray-Fixed-a-crash-issue-that-occurred-when-the-.patch new file mode 100644 index 0000000..ced4245 --- /dev/null +++ b/0003-fix-tray-Fixed-a-crash-issue-that-occurred-when-the-.patch @@ -0,0 +1,69 @@ +From 4428d8c315ac13d8bacc533a9b6cc64bf335d30b Mon Sep 17 00:00:00 2001 +From: luoqing +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 + diff --git a/kiran-menu.spec b/kiran-menu.spec index 88ec387..4675422 100644 --- a/kiran-menu.spec +++ b/kiran-menu.spec @@ -1,12 +1,14 @@ Name: kiran-menu Version: 2.5.1 -Release: 2 +Release: 3 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 BuildRequires: cmake > 3.0 BuildRequires: gcc-c++ @@ -98,6 +100,10 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/ %changelog +* Fri Sep 01 2023 luoqing - 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 - 2.5.1-2 - KYOS-F: Fix crash when clicking on the power option button in vnc.