!83 修复menuItem属性设置为不可见后,但仍然可见的问题;修复当托盘程序未设置Menu时,未调用kiran_sn_icon_context_menu的情况

From: @luoqing_kylinsec 
Reviewed-by: @liubuguiii 
Signed-off-by: @liubuguiii
This commit is contained in:
openeuler-ci-bot 2023-10-09 06:17:19 +00:00 committed by Gitee
commit bb18a149ba
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 84 additions and 1 deletions

View File

@ -0,0 +1,32 @@
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

@ -0,0 +1,45 @@
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

View File

@ -1,6 +1,6 @@
Name: kiran-menu
Version: 2.5.1
Release: 4
Release: 5
Summary: Applets for mate panel from Kiran Desktop
License: MulanPSL-2.0
@ -10,6 +10,8 @@ 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++
@ -101,6 +103,10 @@ 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
* 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)