feature(lockscreen): replace suspend/hibernate/shutdown api with SessionManager.

- 待机休眠关机改为调用会话管理接口

Relates #68459

Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
This commit is contained in:
tangjie02 2023-05-10 18:33:53 +08:00
parent 964a1f71c4
commit 2cf85dfab3
21 changed files with 17 additions and 4876 deletions

View File

@ -1,170 +0,0 @@
From d6faccac23ee5dd61fafded0269d8a12752be0e3 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 13 Oct 2022 20:30:02 +0800
Subject: [PATCH] feature(menu): Add flat class for button to keep consistent
with the color of color block.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 给按钮添加flat样式这样在普通状态下背景是透明的可以跟色块颜色保持一致。
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
data/menu.ui.xml | 10 +++++-----
src/menu/menu-app-item.cpp | 2 ++
src/menu/menu-app-launcher-button.cpp | 1 +
src/menu/menu-applet-window.cpp | 6 ++++++
src/menu/menu-applet-window.h | 4 +++-
src/menu/menu-category-item.cpp | 1 +
src/menu/menu-new-apps-container.cpp | 4 +++-
src/menu/menu-power-button.cpp | 1 +
8 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/data/menu.ui.xml b/data/menu.ui.xml
index 90193b3..ae8fb50 100644
--- a/data/menu.ui.xml
+++ b/data/menu.ui.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow" id="menu-window">
@@ -10,9 +10,6 @@
<property name="default_height">682</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
- <child>
- <placeholder/>
- </child>
<child>
<object class="GtkBox" id="menu-container">
<property name="visible">True</property>
@@ -56,7 +53,7 @@
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkStackSwitcher">
+ <object class="GtkStackSwitcher" id="menu-view-stack-switcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -358,5 +355,8 @@
</child>
</object>
</child>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/src/menu/menu-app-item.cpp b/src/menu/menu-app-item.cpp
index fa672c2..e0959a5 100644
--- a/src/menu/menu-app-item.cpp
+++ b/src/menu/menu-app-item.cpp
@@ -30,6 +30,8 @@ MenuAppItem::MenuAppItem(const std::shared_ptr<Kiran::App> &app_, int _icon_size
auto context = get_style_context();
context->add_class("menu-app-item");
+ // 添加flat样式保证在普通状态下按钮时透明背景
+ context->add_class("flat");
set_text(app_->get_locale_name());
diff --git a/src/menu/menu-app-launcher-button.cpp b/src/menu/menu-app-launcher-button.cpp
index 2bb1419..8453484 100644
--- a/src/menu/menu-app-launcher-button.cpp
+++ b/src/menu/menu-app-launcher-button.cpp
@@ -28,6 +28,7 @@ MenuAppLauncherButton::MenuAppLauncherButton(const std::string &icon_name, const
Gio::APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION);
context->add_class("menu-app-launcher");
+ context->add_class("flat");
}
void MenuAppLauncherButton::on_clicked()
diff --git a/src/menu/menu-applet-window.cpp b/src/menu/menu-applet-window.cpp
index eea61c9..7cc9750 100644
--- a/src/menu/menu-applet-window.cpp
+++ b/src/menu/menu-applet-window.cpp
@@ -214,6 +214,7 @@ void MenuAppletWindow::init_ui()
builder = Gtk::Builder::create_from_resource("/kiran-menu/ui/menu");
builder->get_widget<Gtk::Box>("menu-container", main_box);
builder->get_widget<Gtk::Box>("menu-sider-container", sider_box);
+ builder->get_widget<Gtk::StackSwitcher>("menu-view-stack-switcher", menu_view_stack_switcher);
builder->get_widget<Gtk::Stack>("menu-view-stack", menu_view_stack);
builder->get_widget<Gtk::Stack>("apps-list-stack", apps_list_stack);
@@ -234,6 +235,11 @@ void MenuAppletWindow::init_ui()
sider_box->set_name("menu-left-container");
menu_view_stack->set_name("menu-mid-container");
+ for (const auto &child : menu_view_stack_switcher->get_children())
+ {
+ child->get_style_context()->add_class("flat");
+ }
+
/* 最近访问文档列表 */
auto widget = Gtk::make_managed<RecentFilesWidget>();
recent_files_view->add(*widget);
diff --git a/src/menu/menu-applet-window.h b/src/menu/menu-applet-window.h
index 0eae7d7..c9e9ad6 100644
--- a/src/menu/menu-applet-window.h
+++ b/src/menu/menu-applet-window.h
@@ -176,7 +176,9 @@ private:
Glib::RefPtr<Gtk::Builder> builder;
Gtk::SearchEntry *search_entry;
- Gtk::Stack *menu_view_stack, *apps_list_stack;
+ Gtk::StackSwitcher *menu_view_stack_switcher;
+ Gtk::Stack *menu_view_stack;
+ Gtk::Stack *apps_list_stack;
Gtk::Box *all_apps_page; /* */
Gtk::Box *compact_favorites_view; /* 紧凑模式下的收藏夹页面 */
diff --git a/src/menu/menu-category-item.cpp b/src/menu/menu-category-item.cpp
index 9c48b95..e062660 100644
--- a/src/menu/menu-category-item.cpp
+++ b/src/menu/menu-category-item.cpp
@@ -33,6 +33,7 @@ MenuCategoryItem::MenuCategoryItem(const std::string &name,
auto context = get_style_context();
context->add_class("menu-category-item");
+ context->add_class("flat");
set_clickable(clickable);
category_name = name;
}
diff --git a/src/menu/menu-new-apps-container.cpp b/src/menu/menu-new-apps-container.cpp
index bd12eed..a58e32e 100644
--- a/src/menu/menu-new-apps-container.cpp
+++ b/src/menu/menu-new-apps-container.cpp
@@ -90,9 +90,11 @@ Gtk::ToggleButton *MenuNewAppsContainer::create_expand_button()
button->set_image_position(Gtk::POS_RIGHT);
button->set_alignment(0.0, 0.5);
button->get_style_context()->add_class("menu-expand-button");
+ button->get_style_context()->add_class("flat");
button->signal_toggled().connect(
- [this]() -> void {
+ [this]() -> void
+ {
auto image = dynamic_cast<Gtk::Image *>(expand_button->get_image());
if (expand_button->get_active())
diff --git a/src/menu/menu-power-button.cpp b/src/menu/menu-power-button.cpp
index 1a5a224..0237153 100644
--- a/src/menu/menu-power-button.cpp
+++ b/src/menu/menu-power-button.cpp
@@ -27,6 +27,7 @@ MenuPowerButton::MenuPowerButton() : menu(nullptr)
set_focus_on_click(false);
context->add_class("menu-app-launcher");
+ context->add_class("flat");
}
MenuPowerButton::~MenuPowerButton()
--
2.33.0

File diff suppressed because one or more lines are too long

View File

@ -1,125 +0,0 @@
From 6b28669741d926375bf9b9b129416182b088042d Mon Sep 17 00:00:00 2001
From: huangjiawen <huangjiawen@kylinsec.com.cn>
Date: Thu, 20 Apr 2023 18:02:00 +0800
Subject: [PATCH] feature(menu): Hide UI after click on the power option
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在点击电源选项按钮后,隐藏电源选项模态窗口
Signed-off-by: huangjiawen <huangjiawen@kylinsec.com.cn>
---
src/menu/menu-power-dialog.cpp | 21 +++++++++++++++++++++
src/menu/menu-power-dialog.h | 4 ++++
2 files changed, 25 insertions(+)
diff --git a/src/menu/menu-power-dialog.cpp b/src/menu/menu-power-dialog.cpp
index 1d75cf1..f13594d 100644
--- a/src/menu/menu-power-dialog.cpp
+++ b/src/menu/menu-power-dialog.cpp
@@ -64,6 +64,8 @@ MenuPowerDialog::MenuPowerDialog()
add_power_button(dialog_grid);
+ this->signal_dialog_hide().connect(sigc::mem_fun(*this, &Gtk::Widget::hide));
+
get_style_context()->add_class("power-menu-dialog");
}
@@ -140,10 +142,17 @@ void MenuPowerDialog::add_button(const char *button_icon_name,
dialog_grid->attach(*power_label, space, 1, 1, 1);
}
+sigc::signal<void> MenuPowerDialog::signal_dialog_hide()
+{
+ return signal_dialog_hide_;
+}
+
void MenuPowerDialog::do_reboot()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
power->reboot();
return;
@@ -153,6 +162,8 @@ void MenuPowerDialog::do_logout()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
power->logout(LOGOUT_MODE_NOW);
return;
@@ -162,6 +173,8 @@ void MenuPowerDialog::do_shutdown()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
power->shutdown();
return;
@@ -171,6 +184,8 @@ void MenuPowerDialog::do_hibernate()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
power->hibernate();
return;
@@ -179,6 +194,8 @@ void MenuPowerDialog::do_suspend()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
power->suspend();
return;
@@ -188,6 +205,8 @@ void MenuPowerDialog::do_switch_user()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
if (power->get_graphical_ntvs() >= power->get_ntvs_total())
{
KLOG_DEBUG("Total ntvs: %d, graphical ntvs: %d.", power->get_ntvs_total(), power->get_graphical_ntvs());
@@ -210,6 +229,8 @@ void MenuPowerDialog::do_lock_screen()
{
auto power = KiranPower::get_default();
+ signal_dialog_hide().emit();
+
power->lock_screen();
return;
diff --git a/src/menu/menu-power-dialog.h b/src/menu/menu-power-dialog.h
index 471ab42..724bbf3 100644
--- a/src/menu/menu-power-dialog.h
+++ b/src/menu/menu-power-dialog.h
@@ -32,12 +32,16 @@ public:
void do_switch_user();
void do_lock_screen();
+ sigc::signal<void> signal_dialog_hide();
+
void add_power_button(Gtk::Grid *dialog_grid);
void add_button(const char *button_icon_name,
const char *button_name,
Gtk::Grid *dialog_grid,
int space,
void (MenuPowerDialog::*power_func)());
+protected:
+ sigc::signal<void> signal_dialog_hide_;
};
#endif // MENU_POWER_DIALOG_H
--
2.33.0

View File

@ -1,35 +0,0 @@
From 80277a6d3742c478932bd23ac2ab58efdd2490d8 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 3 Mar 2022 10:13:06 +0800
Subject: [PATCH] feature(menu): Hide the search file tool on start menu.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 隐藏开始菜单中的搜索文件按钮
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/menu-applet-window.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/menu/menu-applet-window.cpp b/src/menu/menu-applet-window.cpp
index 2c96254..1266b2d 100644
--- a/src/menu/menu-applet-window.cpp
+++ b/src/menu/menu-applet-window.cpp
@@ -655,10 +655,10 @@ void MenuAppletWindow::add_sidebar_buttons()
"mate-panel --run-dialog");
side_box->add(*launcher_btn);
- launcher_btn = create_launcher_button("kiran-menu-search-files-symbolic",
+ /*launcher_btn = create_launcher_button("kiran-menu-search-files-symbolic",
_("Search Files"),
"mate-search-tool");
- side_box->add(*launcher_btn);
+ side_box->add(*launcher_btn);*/
launcher_btn = create_launcher_button("kiran-menu-home-dir-symbolic",
_("Home Directory"),
--
2.18.1

View File

@ -1,204 +0,0 @@
From ee1e902961b07f16b22916338bc37b98ba9d9060 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Tue, 9 Aug 2022 09:41:35 +0800
Subject: [PATCH 1/2] fix(connect): Fix some possible crash problems caused by
sigc::slot.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复一些可能存在的崩溃问题,这些崩溃问题是因为槽函数绑定的对象已经被释放导致
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/menu-app-item.cpp | 52 ++++++++++++++++++++------------
src/menu/menu-app-item.h | 5 +++
src/menu/menu-applet-window.cpp | 3 +-
src/menu/menu-apps-container.cpp | 12 ++------
src/menu/menu-apps-container.h | 7 -----
5 files changed, 40 insertions(+), 39 deletions(-)
diff --git a/src/menu/menu-app-item.cpp b/src/menu/menu-app-item.cpp
index fba3994..fa672c2 100644
--- a/src/menu/menu-app-item.cpp
+++ b/src/menu/menu-app-item.cpp
@@ -68,11 +68,7 @@ void MenuAppItem::init_drag_and_drop()
targets.push_back(target);
drag_source_set(targets, Gdk::BUTTON1_MASK, Gdk::ACTION_COPY);
- signal_drag_failed().connect(
- [this](const Glib::RefPtr<Gdk::DragContext> &context, Gtk::DragResult result) -> bool {
- KLOG_DEBUG("drag failed, result %d\n", (int)result);
- return true;
- });
+ signal_drag_failed().connect(sigc::mem_fun(*this, &MenuAppItem::on_drag_failed));
}
bool MenuAppItem::on_button_press_event(GdkEventButton *button_event)
@@ -131,14 +127,22 @@ void MenuAppItem::on_drag_end(const Glib::RefPtr<Gdk::DragContext> &context)
// 如果拖拽被取消拖拽的ungrab操作可能在drag-end信号之后所以这里的grab操作放入到后面的事件循环处理。
if (this->idle_drag_connection_.empty())
{
- this->idle_drag_connection_ = Glib::signal_idle().connect([this]() -> bool {
- Gtk::Container *toplevel = this->get_toplevel();
- KiranHelper::grab_input(*toplevel);
- return false;
- });
+ this->idle_drag_connection_ = Glib::signal_idle().connect(
+ [this]() -> bool
+ {
+ Gtk::Container *toplevel = this->get_toplevel();
+ KiranHelper::grab_input(*toplevel);
+ return false;
+ });
}
}
+bool MenuAppItem::on_drag_failed(const Glib::RefPtr<Gdk::DragContext> &context, Gtk::DragResult result)
+{
+ KLOG_DEBUG("drag failed, result %d\n", (int)result);
+ return true;
+}
+
bool MenuAppItem::on_key_press_event(GdkEventKey *key_event)
{
if (key_event->keyval == GDK_KEY_Menu)
@@ -181,20 +185,12 @@ void MenuAppItem::create_context_menu()
if (!is_in_favorite())
{
item = Gtk::make_managed<Gtk::MenuItem>(_("Add to favorites"));
- item->signal_activate().connect(
- [this]() -> void {
- if (!app.expired())
- Kiran::MenuSkeleton::get_instance()->add_favorite_app(app.lock()->get_desktop_id());
- });
+ item->signal_activate().connect(sigc::mem_fun(*this, &MenuAppItem::on_add_favorite_app));
}
else
{
item = Gtk::make_managed<Gtk::MenuItem>(_("Remove from favorites"));
- item->signal_activate().connect(
- [this]() -> void {
- if (!app.expired())
- Kiran::MenuSkeleton::get_instance()->del_favorite_app(app.lock()->get_desktop_id());
- });
+ item->signal_activate().connect(sigc::mem_fun(*this, &MenuAppItem::on_del_favorite_app));
}
context_menu.append(*item);
@@ -345,3 +341,19 @@ void MenuAppItem::launch_app()
signal_launched().emit();
app.lock()->launch();
}
+
+void MenuAppItem::on_add_favorite_app()
+{
+ if (!this->app.expired())
+ {
+ Kiran::MenuSkeleton::get_instance()->add_favorite_app(app.lock()->get_desktop_id());
+ }
+}
+
+void MenuAppItem::on_del_favorite_app()
+{
+ if (!app.expired())
+ {
+ Kiran::MenuSkeleton::get_instance()->del_favorite_app(app.lock()->get_desktop_id());
+ }
+}
\ No newline at end of file
diff --git a/src/menu/menu-app-item.h b/src/menu/menu-app-item.h
index 39f3767..6caadd7 100644
--- a/src/menu/menu-app-item.h
+++ b/src/menu/menu-app-item.h
@@ -37,6 +37,7 @@ protected:
virtual void on_drag_begin(const Glib::RefPtr<Gdk::DragContext> &context) override;
virtual void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext> &context, Gtk::SelectionData &selection, guint info, guint timestamp) override;
virtual void on_drag_end(const Glib::RefPtr<Gdk::DragContext> &context) override;
+ bool on_drag_failed(const Glib::RefPtr<Gdk::DragContext> &context, Gtk::DragResult result);
virtual void init_drag_and_drop();
@@ -46,6 +47,10 @@ protected:
void create_context_menu();
bool add_app_to_desktop();
+private:
+ void on_add_favorite_app();
+ void on_del_favorite_app();
+
private:
KiranOpacityMenu context_menu;
Gtk::MenuItem *items;
diff --git a/src/menu/menu-applet-window.cpp b/src/menu/menu-applet-window.cpp
index 941c2b8..eea61c9 100644
--- a/src/menu/menu-applet-window.cpp
+++ b/src/menu/menu-applet-window.cpp
@@ -63,8 +63,7 @@ MenuAppletWindow::MenuAppletWindow(Gtk::WindowType window_type) : Glib::ObjectBa
/* 监控工作区域大小变化 */
auto screen = get_screen();
monitor = new WorkareaMonitor(screen);
- monitor->signal_size_changed().connect(
- sigc::mem_fun(*this, &MenuAppletWindow::on_workarea_size_changed));
+ monitor->signal_size_changed().connect(sigc::mem_fun(*this, &MenuAppletWindow::on_workarea_size_changed));
//加载当前用户信息
set_display_mode(profile.get_display_mode());
diff --git a/src/menu/menu-apps-container.cpp b/src/menu/menu-apps-container.cpp
index 4930e46..b849397 100644
--- a/src/menu/menu-apps-container.cpp
+++ b/src/menu/menu-apps-container.cpp
@@ -32,7 +32,8 @@ MenuAppsContainer::MenuAppsContainer(MenuAppsContainer::AppIconMode mode_,
apps_box.get_style_context()->add_class("menu-apps-box");
category_box.signal_clicked().connect_notify(
- [this]() -> void {
+ [this]() -> void
+ {
signal_category_clicked().emit(category_box.get_category_name());
});
@@ -142,11 +143,6 @@ bool MenuAppsContainer::get_category_clickable() const
return category_box.get_clickable();
}
-sigc::signal<void> MenuAppsContainer::signal_app_launched()
-{
- return m_signal_app_launched;
-}
-
sigc::signal<void, const Glib::ustring &> MenuAppsContainer::signal_category_clicked()
{
return m_signal_category_clicked;
@@ -157,10 +153,6 @@ MenuAppItem *MenuAppsContainer::create_app_item(std::shared_ptr<Kiran::App> app,
auto item = new MenuAppItem(app);
item->set_orientation(orient);
- item->signal_launched().connect(
- [this]() -> void {
- signal_app_launched().emit();
- });
return item;
}
diff --git a/src/menu/menu-apps-container.h b/src/menu/menu-apps-container.h
index d5bfcfe..85148e3 100644
--- a/src/menu/menu-apps-container.h
+++ b/src/menu/menu-apps-container.h
@@ -83,13 +83,6 @@ public:
*/
virtual bool load_applications(const Kiran::AppVec &apps);
- /**
- * @brief signal_app_launched 信号,容器内的应用按钮启动时触发
- *
- * @return 返回应用启动信号
- */
- sigc::signal<void> signal_app_launched();
-
/**
* @brief siganl_category_clicked 信号,容器内的应用分类标签点击后触发
*/
--
2.33.0

View File

@ -1,47 +0,0 @@
From 6da7f67dbc6e4d1226a96768256db1c903cf7e95 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 11 Aug 2022 15:27:59 +0800
Subject: [PATCH 1/2] fix(coredump): Fix the coredump problem caused by
RecentFilesListBox::load
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由RecentFilesListBox::load回调函数导致的崩溃问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/recent-files-list-box.cpp | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/menu/recent-files-list-box.cpp b/src/menu/recent-files-list-box.cpp
index 86ffd60..3ae481e 100644
--- a/src/menu/recent-files-list-box.cpp
+++ b/src/menu/recent-files-list-box.cpp
@@ -26,12 +26,7 @@ RecentFilesListBox::RecentFilesListBox() : filter_pattern("*")
get_style_context()->add_class("menu-recent-list");
/* 最近访问文件列表发生变化时重新加载 */
- Gtk::RecentManager::get_default()->signal_changed().connect(
- [this]() {
- KLOG_DEBUG("The recent files are changed.");
- this->load();
- });
-
+ Gtk::RecentManager::get_default()->signal_changed().connect(sigc::mem_fun(this, &RecentFilesListBox::load));
load();
}
@@ -180,7 +175,8 @@ Gtk::Widget *RecentFilesListBox::create_recent_item(const Glib::RefPtr<Gtk::Rece
widget->set_tooltip_text(item->get_display_name());
widget->get_style_context()->add_class("row-box");
widget->signal_button_press_event().connect_notify(
- [widget, context_menu, this](const GdkEventButton *button_event) -> void {
+ [widget, context_menu, this](const GdkEventButton *button_event) -> void
+ {
const GdkEvent *event = (const GdkEvent *)button_event;
if (gdk_event_triggers_context_menu(event))
{
--
2.33.0

View File

@ -1,71 +0,0 @@
From 9933ff89f98c176e7ce097500004ab3da860fb81 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Mon, 14 Nov 2022 20:46:18 +0800
Subject: [PATCH] fix(menu): Fix that the category overlaps the search box
after the start menu collapses the category list.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复开始菜单收起类别列表后,分类与搜索框重叠
Closes #I60PSI
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/menu-applet-window.cpp | 5 ++++-
src/menu/menu-applet-window.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/menu/menu-applet-window.cpp b/src/menu/menu-applet-window.cpp
index 7cc9750..81397a4 100644
--- a/src/menu/menu-applet-window.cpp
+++ b/src/menu/menu-applet-window.cpp
@@ -216,6 +216,7 @@ void MenuAppletWindow::init_ui()
builder->get_widget<Gtk::Box>("menu-sider-container", sider_box);
builder->get_widget<Gtk::StackSwitcher>("menu-view-stack-switcher", menu_view_stack_switcher);
builder->get_widget<Gtk::Stack>("menu-view-stack", menu_view_stack);
+ builder->get_widget<Gtk::Box>("all-apps-view", all_app_view);
builder->get_widget<Gtk::Stack>("apps-list-stack", apps_list_stack);
builder->get_widget<Gtk::Box>("search-box", search_box);
@@ -492,7 +493,7 @@ void MenuAppletWindow::switch_to_category_overview(const std::string &selected_c
true));
category_list_box->add(*item);
}
- all_apps_scrolled->set_visible(false);
+ all_app_view->set_visible(false);
category_list_scrolled->show_all();
if (selected_item)
@@ -536,6 +537,7 @@ void MenuAppletWindow::switch_to_apps_overview(double position, bool animation)
all_apps_scrolled->show_all();
menu_view_stack->set_visible_child(ALL_APPS_VIEW);
+ all_app_view->set_visible(true);
apps_list_stack->set_visible_child(APPS_LIST_PAGE);
if (position >= 0)
{
@@ -550,6 +552,7 @@ bool MenuAppletWindow::on_map_event(GdkEventAny *any_event)
// Fix #53981
category_list_scrolled->set_visible(false);
+ all_app_view->set_visible(true);
all_apps_scrolled->set_visible(true);
on_search_stop();
diff --git a/src/menu/menu-applet-window.h b/src/menu/menu-applet-window.h
index c9e9ad6..7a4d66d 100644
--- a/src/menu/menu-applet-window.h
+++ b/src/menu/menu-applet-window.h
@@ -178,6 +178,7 @@ private:
Gtk::SearchEntry *search_entry;
Gtk::StackSwitcher *menu_view_stack_switcher;
Gtk::Stack *menu_view_stack;
+ Gtk::Box *all_app_view;
Gtk::Stack *apps_list_stack;
Gtk::Box *all_apps_page; /* */
Gtk::Box *compact_favorites_view; /* 紧凑模式下的收藏夹页面 */
--
2.33.0

View File

@ -1,34 +0,0 @@
From 28c431b9323e2201498738fdffaa9a6d1fd562fd Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Wed, 27 Jul 2022 19:38:42 +0800
Subject: [PATCH 1/2] fix(menu): Fix the problem that some apps are show
repeatly in start menu.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复app在开始菜单中重复显示问题
Closes #I5HT8G
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
lib/category.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/category.cpp b/lib/category.cpp
index 10cba91..7d7a9b6 100644
--- a/lib/category.cpp
+++ b/lib/category.cpp
@@ -18,7 +18,7 @@
namespace Kiran
{
-Category::Category(std::shared_ptr<CategoryNode> node) : repeat_(true),
+Category::Category(std::shared_ptr<CategoryNode> node) : repeat_(false),
node_(node)
{
if (node->get_type() != CategoryNodeType::CATEGORY_NODE_TYPE_CATEGORY)
--
2.33.0

View File

@ -1,66 +0,0 @@
From 40e7e134d87727cb651e9d290a852bd9ef95b826 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Mon, 18 Jul 2022 16:20:26 +0800
Subject: [PATCH] fix(menu): Fix the switch user error by xdmcp logging.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复通过xdmcp远程登录后切换用户错误问题
Closes #57865
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/common/kiran-power.cpp | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/common/kiran-power.cpp b/src/common/kiran-power.cpp
index c7f1011..9ef8a2c 100644
--- a/src/common/kiran-power.cpp
+++ b/src/common/kiran-power.cpp
@@ -68,11 +68,18 @@ KiranPower::KiranPower()
SESSION_MANAGER_PATH,
SESSION_MANAGER_INTERFACE);
- // TODO: 这里直接选用seat0是有问题的需要获取会话所在seat
- this->seat_manager_proxy_ = Gio::DBus::Proxy::create_for_bus_sync(Gio::DBus::BUS_TYPE_SYSTEM,
- DISPLAY_MANAGER_DBUS,
- DISPLAY_MANAGER_SEAT_PATH,
- DISPLAY_MANAGER_INTERFACE);
+ auto xdg_seat_object_path = Glib::getenv("XDG_SEAT_PATH");
+ if (!xdg_seat_object_path.empty())
+ {
+ this->seat_manager_proxy_ = Gio::DBus::Proxy::create_for_bus_sync(Gio::DBus::BUS_TYPE_SYSTEM,
+ DISPLAY_MANAGER_DBUS,
+ xdg_seat_object_path,
+ DISPLAY_MANAGER_INTERFACE);
+ }
+ else
+ {
+ KLOG_WARNING("Failed to get environment variable XDG_SEAT_PATH.");
+ }
}
catch (const Gio::DBus::Error &e)
{
@@ -359,6 +366,17 @@ bool KiranPower::can_logout()
bool KiranPower::can_switch_user()
{
RETURN_VAL_IF_TRUE(this->settings_->get_boolean(STARTMENU_LOCKDOWN_KEY_DISABLE_USER_SWITCHING), false);
+
+ try
+ {
+ Glib::VariantBase variant_value;
+ this->seat_manager_proxy_->get_cached_property(variant_value, "CanSwitch");
+ return Glib::VariantBase::cast_dynamic<Glib::Variant<bool>>(variant_value).get();
+ }
+ catch (const Glib::Error &e)
+ {
+ KLOG_WARNING("%s", e.what().c_str());
+ }
return true;
}
--
2.33.0

View File

@ -1,264 +0,0 @@
From b89025f85ee172103524d9505ea7fa4e0878eaaa Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Sat, 30 Jul 2022 13:54:50 +0800
Subject: [PATCH] fix(menu): fix the grab problem when popup menu on search
entry or drag menu app icon.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复在搜索框弹出右键菜单后开始菜单未抓取问题
- 修复开始菜单拖拽到开始菜单后开始菜单未抓取问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/menu-app-item.cpp | 29 +++++++++++++++++------------
src/menu/menu-app-item.h | 5 ++---
src/menu/menu-applet-window.cpp | 21 ++++++++++-----------
src/menu/menu-applet-window.h | 5 -----
src/menu/menu-power-button.cpp | 12 ------------
src/menu/menu-power-button.h | 5 -----
src/menu/recent-files-list-box.cpp | 15 +++++----------
7 files changed, 34 insertions(+), 58 deletions(-)
diff --git a/src/menu/menu-app-item.cpp b/src/menu/menu-app-item.cpp
index e2afab2..fba3994 100644
--- a/src/menu/menu-app-item.cpp
+++ b/src/menu/menu-app-item.cpp
@@ -47,12 +47,14 @@ MenuAppItem::MenuAppItem(const std::shared_ptr<Kiran::App> &app_, int _icon_size
set_can_focus(true);
set_tooltip_text(app_->get_locale_comment());
- context_menu.signal_deactivate().connect(
- sigc::mem_fun(*this, &MenuAppItem::on_context_menu_deactivated));
-
init_drag_and_drop();
}
+MenuAppItem::~MenuAppItem()
+{
+ this->idle_drag_connection_.disconnect();
+}
+
const std::shared_ptr<Kiran::App> MenuAppItem::get_app() const
{
return app.lock();
@@ -122,16 +124,19 @@ void MenuAppItem::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext> &context
void MenuAppItem::on_drag_end(const Glib::RefPtr<Gdk::DragContext> &context)
{
- /* 让开始菜单窗口重新获取输入焦点 */
- Gtk::Container *toplevel = get_toplevel();
- KiranHelper::grab_input(*toplevel);
-}
+ /* FIXME: 当拖动图标到任务栏时无法收到drag-end信号因为任务栏时kiran-panel的子窗口kiran-panel是通过
+ 代理的方式将拖拽信息发送给任务栏,但是任务栏拖拽完成后,这个代理并没有把完成的消息转发给源控件(开始菜单),
+ 因此无法收到drag-end信号当前函数也不会被调用。这个时候窗口不再被抓取需要手动点击左下角开始菜单按钮才能隐藏。*/
-void MenuAppItem::on_context_menu_deactivated()
-{
- /* 让开始菜单窗口重新获取输入焦点 */
- auto toplevel = get_toplevel();
- KiranHelper::grab_input(*toplevel);
+ // 如果拖拽被取消拖拽的ungrab操作可能在drag-end信号之后所以这里的grab操作放入到后面的事件循环处理。
+ if (this->idle_drag_connection_.empty())
+ {
+ this->idle_drag_connection_ = Glib::signal_idle().connect([this]() -> bool {
+ Gtk::Container *toplevel = this->get_toplevel();
+ KiranHelper::grab_input(*toplevel);
+ return false;
+ });
+ }
}
bool MenuAppItem::on_key_press_event(GdkEventKey *key_event)
diff --git a/src/menu/menu-app-item.h b/src/menu/menu-app-item.h
index db7c0f3..39f3767 100644
--- a/src/menu/menu-app-item.h
+++ b/src/menu/menu-app-item.h
@@ -23,7 +23,7 @@ class MenuAppItem : public MenuListItemWidget
{
public:
MenuAppItem(const std::shared_ptr<Kiran::App> &_app, int icon_size = 24, Gtk::Orientation orient = Gtk::ORIENTATION_HORIZONTAL);
- ~MenuAppItem() = default;
+ virtual ~MenuAppItem();
sigc::signal<void> signal_launched();
virtual void set_orientation(Gtk::Orientation orient) override;
void launch_app();
@@ -38,8 +38,6 @@ protected:
virtual void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext> &context, Gtk::SelectionData &selection, guint info, guint timestamp) override;
virtual void on_drag_end(const Glib::RefPtr<Gdk::DragContext> &context) override;
- virtual void on_context_menu_deactivated();
-
virtual void init_drag_and_drop();
bool pin_app_to_taskbar();
@@ -55,6 +53,7 @@ private:
bool menu_shown;
sigc::signal<void> m_signal_launched;
+ sigc::connection idle_drag_connection_;
bool is_in_favorite();
bool is_fixed_on_taskbar();
diff --git a/src/menu/menu-applet-window.cpp b/src/menu/menu-applet-window.cpp
index 952e401..941c2b8 100644
--- a/src/menu/menu-applet-window.cpp
+++ b/src/menu/menu-applet-window.cpp
@@ -71,6 +71,16 @@ MenuAppletWindow::MenuAppletWindow(Gtk::WindowType window_type) : Glib::ObjectBa
signal_grab_broken_event().connect(
sigc::mem_fun(*this, &MenuAppletWindow::on_grab_broken_event));
+
+ // 窗口激活时抓取窗口
+ this->property_is_active().signal_changed().connect(
+ [this]() -> void
+ {
+ if (this->property_is_active().get_value())
+ {
+ KiranHelper::grab_input(*this);
+ }
+ });
}
MenuAppletWindow::~MenuAppletWindow()
@@ -193,11 +203,6 @@ bool MenuAppletWindow::on_grab_broken_event(GdkEventGrabBroken *grab_broken_even
return false;
}
-void MenuAppletWindow::on_power_menu_deactivated()
-{
- KiranHelper::grab_input(*this);
-}
-
void MenuAppletWindow::init_ui()
{
Gtk::Box *search_box, *main_box, *sider_box;
@@ -544,10 +549,6 @@ bool MenuAppletWindow::on_map_event(GdkEventAny *any_event)
on_search_stop();
- /*
- * 获取当前系统的鼠标事件,这样才能在鼠标点击窗口外部时及时隐藏窗口
- */
- KiranHelper::grab_input(*this);
if (display_mode == DISPLAY_MODE_EXPAND || profile.get_default_page() == PAGE_ALL_APPS)
search_entry->grab_focus();
return true;
@@ -677,8 +678,6 @@ void MenuAppletWindow::add_sidebar_buttons()
side_box->add(*launcher_btn);
auto power_btn = Gtk::make_managed<MenuPowerButton>();
- power_btn->signal_power_menu_deactivated().connect(
- sigc::mem_fun(*this, &MenuAppletWindow::on_power_menu_deactivated));
side_box->add(*power_btn);
side_box->show_all();
diff --git a/src/menu/menu-applet-window.h b/src/menu/menu-applet-window.h
index d6224a4..0eae7d7 100644
--- a/src/menu/menu-applet-window.h
+++ b/src/menu/menu-applet-window.h
@@ -105,11 +105,6 @@ protected:
*/
virtual bool on_grab_broken_event(GdkEventGrabBroken *grab_broken_event);
- /**
- * @brief 回调函数,电源菜单关闭时调用
- */
- virtual void on_power_menu_deactivated();
-
virtual void init_ui();
virtual void init_avatar_widget();
diff --git a/src/menu/menu-power-button.cpp b/src/menu/menu-power-button.cpp
index 3b07e89..1a5a224 100644
--- a/src/menu/menu-power-button.cpp
+++ b/src/menu/menu-power-button.cpp
@@ -34,11 +34,6 @@ MenuPowerButton::~MenuPowerButton()
delete menu;
}
-sigc::signal<void> MenuPowerButton::signal_power_menu_deactivated()
-{
- return m_signal_power_menu_deactivated;
-}
-
void MenuPowerButton::on_clicked()
{
GdkEvent *event = gtk_get_current_event();
@@ -47,16 +42,9 @@ void MenuPowerButton::on_clicked()
delete menu;
menu = new MenuPowerMenu();
- menu->signal_deactivate().connect(
- sigc::mem_fun(*this, &MenuPowerButton::on_power_menu_deactivated));
menu->attach_to_widget(*this);
menu->show_all();
menu->popup_at_widget(this, Gdk::GRAVITY_SOUTH_EAST, Gdk::GRAVITY_SOUTH_WEST, event);
gdk_event_free(event);
}
-
-void MenuPowerButton::on_power_menu_deactivated()
-{
- signal_power_menu_deactivated().emit();
-}
diff --git a/src/menu/menu-power-button.h b/src/menu/menu-power-button.h
index 9fec030..fb94225 100644
--- a/src/menu/menu-power-button.h
+++ b/src/menu/menu-power-button.h
@@ -24,17 +24,12 @@ public:
MenuPowerButton();
~MenuPowerButton();
- sigc::signal<void> signal_power_menu_deactivated();
-
protected:
virtual void on_clicked() override;
- virtual void on_power_menu_deactivated();
private:
Gtk::Image icon;
Gtk::Menu *menu;
-
- sigc::signal<void> m_signal_power_menu_deactivated;
};
#endif // MENU_POWER_BUTTON_H
diff --git a/src/menu/recent-files-list-box.cpp b/src/menu/recent-files-list-box.cpp
index 3f8e869..86ffd60 100644
--- a/src/menu/recent-files-list-box.cpp
+++ b/src/menu/recent-files-list-box.cpp
@@ -26,10 +26,11 @@ RecentFilesListBox::RecentFilesListBox() : filter_pattern("*")
get_style_context()->add_class("menu-recent-list");
/* 最近访问文件列表发生变化时重新加载 */
- Gtk::RecentManager::get_default()->signal_changed().connect([this]() {
- KLOG_DEBUG("The recent files are changed.");
- this->load();
- });
+ Gtk::RecentManager::get_default()->signal_changed().connect(
+ [this]() {
+ KLOG_DEBUG("The recent files are changed.");
+ this->load();
+ });
load();
}
@@ -172,12 +173,6 @@ Gtk::Widget *RecentFilesListBox::create_recent_item(const Glib::RefPtr<Gtk::Rece
g_assert(context_menu != nullptr);
context_menu->attach_to_widget(*widget);
- context_menu->signal_deactivate().connect(
- [this]() -> void {
- auto toplevel = get_toplevel();
- KiranHelper::grab_input(*toplevel);
- });
-
label->set_ellipsize(Pango::ELLIPSIZE_END);
label->set_xalign(0.0f);
--
2.33.0

View File

@ -1,103 +0,0 @@
From ef54af3c33b1e779a3fc11ff5925ffe07c137958 Mon Sep 17 00:00:00 2001
From: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
Date: Thu, 1 Dec 2022 11:21:44 +0800
Subject: [PATCH] fix(tray): Fix memory leak due to notification area.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由于通知区域导致内存泄漏的问题
Closes #I63Q6H
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
---
src/tray/kiran-notify-icon-window.c | 3 +++
src/tray/kiran-sn-icon.c | 4 ++++
src/tray/kiran-tray.c | 2 ++
src/tray/kiran-x11-tray-icon.cpp | 6 +-----
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/tray/kiran-notify-icon-window.c b/src/tray/kiran-notify-icon-window.c
index 07fe89a..37381f4 100644
--- a/src/tray/kiran-notify-icon-window.c
+++ b/src/tray/kiran-notify-icon-window.c
@@ -198,6 +198,7 @@ kiran_notify_icon_window_focus_in_event(GtkWidget *widget,
break;
}
}
+ g_list_free(children);
}
return FALSE;
@@ -232,6 +233,7 @@ kiran_notify_icon_window_focus_out_event(GtkWidget *widget,
break;
}
}
+ g_list_free(children);
return FALSE;
}
@@ -415,6 +417,7 @@ kiran_notify_icon_window_icons_refresh(KiranNotifyIconWindow *window,
}
gtk_widget_set_size_request(GTK_WIDGET(window), max_row * 40, (row + 1) * 40);
+ g_list_free(children);
}
static void
diff --git a/src/tray/kiran-sn-icon.c b/src/tray/kiran-sn-icon.c
index f312458..a36040d 100644
--- a/src/tray/kiran-sn-icon.c
+++ b/src/tray/kiran-sn-icon.c
@@ -542,6 +542,10 @@ update(KiranSnIcon *icon)
}
gtk_image_set_from_surface(GTK_IMAGE(priv->image), surface);
+ if(surface)
+ {
+ cairo_surface_destroy(surface);
+ }
g_free(priv->icon);
priv->icon = g_strdup(priv->icon_name);
}
diff --git a/src/tray/kiran-tray.c b/src/tray/kiran-tray.c
index c169a1e..9b40d96 100644
--- a/src/tray/kiran-tray.c
+++ b/src/tray/kiran-tray.c
@@ -227,6 +227,7 @@ gsettings_changed_panel_icon_ids(GSettings *settings,
g_strfreev(panel_icon_ids);
}
+ g_list_free(children);
}
static void
@@ -494,6 +495,7 @@ kiran_tray_icons_refresh(KiranTray *tray)
NULL);
col++;
}
+ g_list_free(children);
}
static void
diff --git a/src/tray/kiran-x11-tray-icon.cpp b/src/tray/kiran-x11-tray-icon.cpp
index b31a97b..63e6a80 100644
--- a/src/tray/kiran-x11-tray-icon.cpp
+++ b/src/tray/kiran-x11-tray-icon.cpp
@@ -535,11 +535,7 @@ kiran_x11_tray_icon_new(Window icon_window)
icon->priv->has_desktop = FALSE;
}
}
- else
- {
- g_free(res_name);
- }
-
+ g_free(res_name);
g_free(res_class);
return GTK_WIDGET(icon);
--
2.36.1

View File

@ -1,132 +0,0 @@
From 49591a3b1b1c2f58b8b4a7cacfa7093fad26a3ab Mon Sep 17 00:00:00 2001
From: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
Date: Tue, 6 Sep 2022 10:20:27 +0800
Subject: [PATCH] fix(tray):Fix the dbus icon can not scaled when system scale
changed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复当系统显示设置放大2倍数托盘声音网络通知图标未放大的问题
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
---
src/tray/kiran-sn-icon.c | 51 +++++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 22 deletions(-)
diff --git a/src/tray/kiran-sn-icon.c b/src/tray/kiran-sn-icon.c
index b6644c3..f312458 100644
--- a/src/tray/kiran-sn-icon.c
+++ b/src/tray/kiran-sn-icon.c
@@ -202,9 +202,10 @@ kiran_sn_tooltip_new(GVariant *variant)
return tooltip;
}
-static GdkPixbuf *
+static cairo_surface_t *
get_icon_by_name(const gchar *icon_name,
- gint requested_size)
+ gint requested_size,
+ gint scale)
{
GtkIconTheme *icon_theme;
gint *sizes;
@@ -235,9 +236,9 @@ get_icon_by_name(const gchar *icon_name,
if (chosen_size == 0)
chosen_size = requested_size;
- return gtk_icon_theme_load_icon(icon_theme, icon_name,
- chosen_size, GTK_ICON_LOOKUP_FORCE_SIZE,
- NULL);
+ return gtk_icon_theme_load_surface(icon_theme, icon_name,
+ chosen_size, scale,
+ NULL, GTK_ICON_LOOKUP_FORCE_SIZE, NULL);
}
static cairo_surface_t *
@@ -501,44 +502,46 @@ update(KiranSnIcon *icon)
KiranSnIconPrivate *priv;
KiranSnTooltip *tip;
gint icon_size;
- gint scale;
priv = KIRAN_SN_ICON_GET_PRIVATE(icon);
- scale = gtk_widget_get_scale_factor(GTK_WIDGET(priv->image));
if (priv->icon_size > 0)
icon_size = priv->icon_size;
else
icon_size = MAX(1, priv->effective_icon_size);
- icon_size = icon_size * scale;
-
if (priv->icon_name != NULL && priv->icon_name[0] != '\0')
{
- GdkPixbuf *pixbuf;
- pixbuf = get_icon_by_name(priv->icon_name, icon_size);
- if (!pixbuf)
+ cairo_surface_t *surface;
+ gint scale;
+
+ scale = gtk_widget_get_scale_factor(GTK_WIDGET(priv->image));
+ surface = get_icon_by_name(priv->icon_name, icon_size, scale);
+ if (!surface)
{
+ GdkPixbuf *pixbuf;
+
/*try to find icons specified by path and filename*/
pixbuf = gdk_pixbuf_new_from_file(priv->icon_name, NULL);
if (pixbuf && icon_size > 1)
{
/*An icon specified by path and filename may be the wrong size for the tray */
- pixbuf = gdk_pixbuf_scale_simple(pixbuf, scale * icon_size - 2, scale * icon_size - 2, GDK_INTERP_BILINEAR);
+ pixbuf = gdk_pixbuf_scale_simple(pixbuf, icon_size - 2, icon_size - 2, GDK_INTERP_BILINEAR);
+ surface = gdk_cairo_surface_create_from_pixbuf(pixbuf, scale, NULL);
+ }
+
+ if (pixbuf)
+ {
+ g_object_unref(pixbuf);
}
}
- if (!pixbuf)
+ if (!surface)
{
/*deal with missing icon or failure to load icon*/
- pixbuf = get_icon_by_name("image-missing", icon_size);
- }
-
- if (pixbuf)
- {
- gtk_image_set_from_pixbuf(GTK_IMAGE(priv->image), pixbuf);
- g_object_unref(pixbuf);
+ surface = get_icon_by_name("image-missing", icon_size, scale);
}
+ gtk_image_set_from_surface(GTK_IMAGE(priv->image), surface);
g_free(priv->icon);
priv->icon = g_strdup(priv->icon_name);
}
@@ -551,7 +554,6 @@ update(KiranSnIcon *icon)
icon_size);
if (surface != NULL)
{
- cairo_surface_set_device_scale(surface, scale, scale);
gtk_image_set_from_surface(GTK_IMAGE(priv->image), surface);
g_free(priv->icon);
@@ -579,6 +581,11 @@ update(KiranSnIcon *icon)
cairo_surface_destroy(surface);
}
}
+ else
+ {
+ gtk_image_set_from_icon_name(GTK_IMAGE(priv->image), "image-missing", GTK_ICON_SIZE_MENU);
+ gtk_image_set_pixel_size(GTK_IMAGE(priv->image), icon_size);
+ }
tip = priv->tooltip;
if (tip != NULL)
--
2.36.1

View File

@ -1,33 +0,0 @@
From b2dc162c8ebaea927582a423b7467fd00023ab98 Mon Sep 17 00:00:00 2001
From: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
Date: Tue, 30 Aug 2022 11:22:55 +0800
Subject: [PATCH] fix(tray):Fix the icon location error when system resolution
change
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复托盘区域获取托盘位置图标,更改分辨率后错误问题
Releated #I5O77O
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
---
src/tray/kiran-tray.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tray/kiran-tray.c b/src/tray/kiran-tray.c
index 2e7d1b9..c169a1e 100644
--- a/src/tray/kiran-tray.c
+++ b/src/tray/kiran-tray.c
@@ -992,7 +992,7 @@ get_widget_geometry(GtkWidget *widget)
{
window = gtk_widget_get_window(parent);
{
- gdk_window_get_position(window, &x, &y);
+ gdk_window_get_origin(window, &x, &y);
}
parent = gtk_widget_get_parent(parent);
}
--
2.36.1

View File

@ -1,33 +0,0 @@
From c3c06ad8ea3758d496ceff5526fabfe9e5585c27 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 25 Aug 2022 09:16:58 +0800
Subject: [PATCH 2/2] feature(gitlab): Add .gitlab-ci.yml
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加ci配置文件
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
.gitlab-ci.yml | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 .gitlab-ci.yml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..66ea6e7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,8 @@
+variables:
+ RPM_BUILD_REQUIRES: 'cmake make gcc-c++ gtkmm30-devel gettext libwnck3-devel kiran-cc-daemon-devel libX11-devel libxcb-devel libXcomposite-devel mate-desktop-devel cairomm-devel kiran-log-gtk3-devel libdbusmenu-devel libxml2-devel fmt-devel kiran-panel kiran-panel-libs kiran-panel-devel json-glib-devel'
+
+include:
+ - project: 'os/gitlab-ci'
+ ref: main
+ file: '/cmake/cxx.gitlab-ci.yml'
+
--
2.33.0

View File

@ -1,804 +0,0 @@
From 427082b52f1ec2cf91bcdf1e976e2433e90a072a Mon Sep 17 00:00:00 2001
From: huangjiawen <huangjiawen@kylinsec.com.cn>
Date: Wed, 29 Mar 2023 14:01:24 +0800
Subject: [PATCH 2/2] feature(menu): Add UI for modal power options
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加模态电源选项功能界面
Related #67101
Signed-off-by: huangjiawen <huangjiawen@kylinsec.com.cn>
---
config.h.in | 1 +
icons/kiran-power-hibernate.svg | 42 ++++++
icons/kiran-power-lock_screen.svg | 42 ++++++
icons/kiran-power-logout.svg | 42 ++++++
icons/kiran-power-reboot.svg | 42 ++++++
icons/kiran-power-shutdown.svg | 42 ++++++
icons/kiran-power-suspend.svg | 42 ++++++
icons/kiran-power-switch_user.svg | 42 ++++++
src/menu/menu-applet-window.cpp | 21 ++-
src/menu/menu-applet-window.h | 2 +
src/menu/menu-power-button.cpp | 19 +++
src/menu/menu-power-button.h | 6 +
src/menu/menu-power-dialog.cpp | 216 ++++++++++++++++++++++++++++++
src/menu/menu-power-dialog.h | 43 ++++++
14 files changed, 601 insertions(+), 1 deletion(-)
create mode 100644 icons/kiran-power-hibernate.svg
create mode 100644 icons/kiran-power-lock_screen.svg
create mode 100644 icons/kiran-power-logout.svg
create mode 100644 icons/kiran-power-reboot.svg
create mode 100644 icons/kiran-power-shutdown.svg
create mode 100644 icons/kiran-power-suspend.svg
create mode 100644 icons/kiran-power-switch_user.svg
create mode 100644 src/menu/menu-power-dialog.cpp
create mode 100644 src/menu/menu-power-dialog.h
diff --git a/config.h.in b/config.h.in
index 33b04f2..7369f6f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -5,4 +5,5 @@
#define PACKAGE_VERSION "@PROJECT_VERSION@"
#define GETTEXT_PACKAGE PACKAGE_NAME
#define COPYRIGHT "Copyright ©2020 KylinSec. All rights reserved."
+#cmakedefine POWER_DIALOG
diff --git a/icons/kiran-power-hibernate.svg b/icons/kiran-power-hibernate.svg
new file mode 100644
index 0000000..146b603
--- /dev/null
+++ b/icons/kiran-power-hibernate.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="睡眠" class="cls-1" d="M960.047,552c-0.364,0-.743-0.014-1.121-0.044a16.052,16.052,0,0,1-.873-31.941,1.779,1.779,0,0,1,1.5,3.011,9.487,9.487,0,0,0,13.419,13.411,1.8,1.8,0,0,1,2.037-.32,1.77,1.77,0,0,1,.976,1.818A16.044,16.044,0,0,1,960.047,552h0Zm-4.512-28.407a13.154,13.154,0,1,0,16.883,16.873,12.4,12.4,0,0,1-16.883-16.873h0Zm0,0" transform="translate(-943.985 -520)"/>
+</svg>
diff --git a/icons/kiran-power-lock_screen.svg b/icons/kiran-power-lock_screen.svg
new file mode 100644
index 0000000..0dea8ec
--- /dev/null
+++ b/icons/kiran-power-lock_screen.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="锁屏" class="cls-1" d="M1056.72,533.141h-19.88v-8.363a2.165,2.165,0,0,1,2.23-2.091h9.86a2.165,2.165,0,0,1,2.23,2.091v9.539a0.308,0.308,0,0,0,.32.3h2.22a0.308,0.308,0,0,0,.32-0.3v-9.539a4.942,4.942,0,0,0-5.09-4.779h-9.86a4.936,4.936,0,0,0-5.09,4.779v8.363h-2.71a1.234,1.234,0,0,0-1.27,1.194V550.8a1.234,1.234,0,0,0,1.27,1.2h25.45a1.237,1.237,0,0,0,1.28-1.2V534.335a1.237,1.237,0,0,0-1.28-1.194h0Zm-1.59,16.17h-22.27V535.828h22.27v13.483Zm0,0" transform="translate(-1028 -520)"/>
+</svg>
diff --git a/icons/kiran-power-logout.svg b/icons/kiran-power-logout.svg
new file mode 100644
index 0000000..b7a1645
--- /dev/null
+++ b/icons/kiran-power-logout.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="注销" class="cls-1" d="M891.874,536.262l-5.807,4.667a0.328,0.328,0,0,1-.532-0.262V537.5H872.686a0.332,0.332,0,0,1-.328-0.333v-2.334a0.332,0.332,0,0,1,.328-0.333h12.849v-3.167a0.327,0.327,0,0,1,.532-0.262l5.807,4.667A0.335,0.335,0,0,1,891.874,536.262Zm-0.757-10.487h-2.2a0.321,0.321,0,0,1-.315-0.321v-2.575H862.828v26.242H888.6v-2.575a0.321,0.321,0,0,1,.315-0.321h2.2a0.318,0.318,0,0,1,.315.321v4.175A1.266,1.266,0,0,1,890.172,552H861.256A1.266,1.266,0,0,1,860,550.721V521.279A1.266,1.266,0,0,1,861.256,520h28.92a1.266,1.266,0,0,1,1.256,1.279v4.175A0.318,0.318,0,0,1,891.117,525.775Z" transform="translate(-860 -520)"/>
+</svg>
diff --git a/icons/kiran-power-reboot.svg b/icons/kiran-power-reboot.svg
new file mode 100644
index 0000000..98de3b5
--- /dev/null
+++ b/icons/kiran-power-reboot.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="重启" class="cls-1" d="M801.848,549.493a16.657,16.657,0,0,0,6.152-13,16.007,16.007,0,1,0-32,0,16.646,16.646,0,0,0,5.9,12.793,0.318,0.318,0,0,0,.456-0.053l1.576-2.083a0.338,0.338,0,0,0-.048-0.458,12.6,12.6,0,0,1-.936-0.874,13.172,13.172,0,0,1-2.744-4.195,13.6,13.6,0,0,1,0-10.265,13.172,13.172,0,0,1,2.744-4.195,12.739,12.739,0,0,1,4.068-2.829,12.508,12.508,0,0,1,9.964,0,12.739,12.739,0,0,1,4.068,2.829,13.172,13.172,0,0,1,2.744,4.195,13.631,13.631,0,0,1,0,10.269,13.229,13.229,0,0,1-3.916,5.267l-1.628-2.149a0.317,0.317,0,0,0-.564.124l-1.584,6.69a0.329,0.329,0,0,0,.308.408l6.68,0.033a0.329,0.329,0,0,0,.252-0.532Zm0,0" transform="translate(-776 -520)"/>
+</svg>
diff --git a/icons/kiran-power-shutdown.svg b/icons/kiran-power-shutdown.svg
new file mode 100644
index 0000000..e36fa4a
--- /dev/null
+++ b/icons/kiran-power-shutdown.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="关机" class="cls-1" d="M707.963,552a16.023,16.023,0,0,1-7.139-30.342,0.3,0.3,0,0,1,.429.267V524.3a0.593,0.593,0,0,1-.278.5,13.321,13.321,0,0,0-2.3,1.844,13.188,13.188,0,1,0,18.644,0,13,13,0,0,0-2.3-1.844,0.609,0.609,0,0,1-.279-0.5v-2.378a0.3,0.3,0,0,1,.431-0.266A16.022,16.022,0,0,1,707.963,552Zm1.217-14.223h-2.372a0.3,0.3,0,0,1-.3-0.3V520.294a0.3,0.3,0,0,1,.3-0.3h2.372a0.3,0.3,0,0,1,.3.3V537.48A0.3,0.3,0,0,1,709.18,537.776Z" transform="translate(-692 -520)"/>
+</svg>
diff --git a/icons/kiran-power-suspend.svg b/icons/kiran-power-suspend.svg
new file mode 100644
index 0000000..c6ea79b
--- /dev/null
+++ b/icons/kiran-power-suspend.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="待机" class="cls-1" d="M1227.71,532.418h-9.3a0.289,0.289,0,0,0-.29.287v1.718a0.289,0.289,0,0,0,.29.287h9.3a0.289,0.289,0,0,0,.29-0.287v-1.718a0.289,0.289,0,0,0-.29-0.287h0Zm-4.87,4.87h-4.43a0.289,0.289,0,0,0-.29.287v1.718a0.289,0.289,0,0,0,.29.287h4.43a0.289,0.289,0,0,0,.29-0.287v-1.718a0.289,0.289,0,0,0-.29-0.287h0Zm-12.12-8.075h-1.57a0.4,0.4,0,0,0-.41.4v8.88a0.384,0.384,0,0,0,.17.322l5.41,3.889a0.4,0.4,0,0,0,.56-0.086l0.94-1.257v0a0.4,0.4,0,0,0-.09-0.559l-4.61-3.28v-7.906a0.4,0.4,0,0,0-.4-0.4h0Zm0,0,11.9,12.583h-2.1a0.6,0.6,0,0,0-.51.276,11.592,11.592,0,0,1-9.8,5.336,11.6,11.6,0,0,1-4.5-.9,11.524,11.524,0,0,1-6.16-6.073,11.287,11.287,0,0,1,0-8.88,11.524,11.524,0,0,1,6.16-6.073,11.676,11.676,0,0,1,12.69,2.445,11.785,11.785,0,0,1,1.61,2,0.6,0.6,0,0,0,.51.276h2.1a0.322,0.322,0,0,0,.29-0.476,14,14,0,1,0,0,12.547,0.326,0.326,0,0,0-.29-0.477h0Zm0,0" transform="translate(-1196 -520)"/>
+</svg>
diff --git a/icons/kiran-power-switch_user.svg b/icons/kiran-power-switch_user.svg
new file mode 100644
index 0000000..42d584a
--- /dev/null
+++ b/icons/kiran-power-switch_user.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreatorTool>Adobe Photoshop CC 2017 (Windows)</xmp:CreatorTool>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?></metadata>
+<defs>
+ <style>
+ .cls-1 {
+ fill: #fff;
+ fill-rule: evenodd;
+ }
+ </style>
+ </defs>
+ <path id="切换用户" class="cls-1" d="M1144,551.671a0.324,0.324,0,0,1-.32.329h-2.24a0.318,0.318,0,0,1-.32-0.308,9.125,9.125,0,0,0-18.24,0,0.318,0.318,0,0,1-.32.308h-2.24a0.324,0.324,0,0,1-.32-0.329,11.993,11.993,0,0,1,6.96-10.571,8.005,8.005,0,1,1,10.07,0,12.108,12.108,0,0,1,3.46,2.416A11.9,11.9,0,0,1,1144,551.671Zm-6.88-16.791a5.084,5.084,0,0,0-1.53-3.656,5.163,5.163,0,0,0-3.64-1.464A5.12,5.12,0,1,0,1137.12,534.88Zm-6.21-10.02a9.907,9.907,0,0,0-2.21.5,0.315,0.315,0,0,1-.37-0.128,5.181,5.181,0,0,0-.82-0.976,5.122,5.122,0,0,0-7.07,7.412,4.969,4.969,0,0,0,1.48,1,0.335,0.335,0,0,1,.18.352,9.522,9.522,0,0,0-.18,1.86,9.24,9.24,0,0,0,.06,1.056,0.316,0.316,0,0,1-.24.348,9.132,9.132,0,0,0-6.86,8.528,0.311,0.311,0,0,1-.32.308h-2.24a0.323,0.323,0,0,1-.32-0.328,11.9,11.9,0,0,1,3.51-8.16,12.108,12.108,0,0,1,3.46-2.416,8,8,0,1,1,12.19-9.82A0.318,0.318,0,0,1,1130.91,524.86Z" transform="translate(-1112 -520)"/>
+</svg>
diff --git a/src/menu/menu-applet-window.cpp b/src/menu/menu-applet-window.cpp
index 81397a4..2637eca 100644
--- a/src/menu/menu-applet-window.cpp
+++ b/src/menu/menu-applet-window.cpp
@@ -21,14 +21,16 @@
#include "lib/base.h"
#include "menu-app-launcher-button.h"
#include "menu-power-button.h"
+#include "menu-power-dialog.h"
#include "window-manager.h"
-
+#include "global.h"
#include <glibmm/i18n.h>
#include <unistd.h>
#include <iostream>
#include "global.h"
#include "menu-apps-container.h"
#include "recent-files-widget.h"
+#include "config.h"
#define NEW_APPS_MAX_SIZE 3
@@ -643,6 +645,18 @@ Gtk::Button *MenuAppletWindow::create_launcher_button(const std::string &icon_na
return button;
}
+Gtk::Button *MenuAppletWindow::create_power_dialog_button()
+{
+ MenuPowerButton *button;
+ button = Gtk::make_managed<MenuPowerButton>();
+
+ set_transient_for(*this);
+
+ button->signal_menu_hide().connect(sigc::mem_fun(*this, &Gtk::Widget::hide));
+
+ return button;
+}
+
void MenuAppletWindow::add_sidebar_buttons()
{
Gtk::Separator *separator;
@@ -685,7 +699,12 @@ void MenuAppletWindow::add_sidebar_buttons()
"mate-system-monitor");
side_box->add(*launcher_btn);
+
+#ifdef POWER_DIALOG
+ auto power_btn = create_power_dialog_button();
+#else
auto power_btn = Gtk::make_managed<MenuPowerButton>();
+#endif
side_box->add(*power_btn);
side_box->show_all();
diff --git a/src/menu/menu-applet-window.h b/src/menu/menu-applet-window.h
index 7a4d66d..d34cf5d 100644
--- a/src/menu/menu-applet-window.h
+++ b/src/menu/menu-applet-window.h
@@ -242,4 +242,6 @@ private:
Gtk::Button *create_page_button(const char *icon_resource,
const char *tooltip,
int page_index);
+
+ Gtk::Button *create_power_dialog_button();
};
diff --git a/src/menu/menu-power-button.cpp b/src/menu/menu-power-button.cpp
index 0237153..622481b 100644
--- a/src/menu/menu-power-button.cpp
+++ b/src/menu/menu-power-button.cpp
@@ -13,7 +13,10 @@
*/
#include "menu-power-button.h"
+#include "menu-power-dialog.h"
#include <glibmm/i18n.h>
+#include <gtkmm/menu.h>
+
#include "kiran-helper.h"
MenuPowerButton::MenuPowerButton() : menu(nullptr)
@@ -32,7 +35,12 @@ MenuPowerButton::MenuPowerButton() : menu(nullptr)
MenuPowerButton::~MenuPowerButton()
{
+#ifdef POWER_DIALOG
+ delete dialog_;
+#else
delete menu;
+#endif
+
}
void MenuPowerButton::on_clicked()
@@ -42,10 +50,21 @@ void MenuPowerButton::on_clicked()
if (menu)
delete menu;
+#ifdef POWER_DIALOG
+ dialog_ = new MenuPowerDialog();
+ dialog_->show_all();
+#else
menu = new MenuPowerMenu();
menu->attach_to_widget(*this);
menu->show_all();
menu->popup_at_widget(this, Gdk::GRAVITY_SOUTH_EAST, Gdk::GRAVITY_SOUTH_WEST, event);
+#endif
gdk_event_free(event);
}
+
+
+sigc::signal<void> MenuPowerButton::signal_menu_hide()
+{
+ return m_signal_menu_hide;
+}
diff --git a/src/menu/menu-power-button.h b/src/menu/menu-power-button.h
index fb94225..82151b0 100644
--- a/src/menu/menu-power-button.h
+++ b/src/menu/menu-power-button.h
@@ -16,6 +16,7 @@
#define MENU_POWER_BUTTON_H
#include <gtkmm.h>
+#include "config.h"
#include "menu-power-menu.h"
class MenuPowerButton : public Gtk::Button
@@ -23,13 +24,18 @@ class MenuPowerButton : public Gtk::Button
public:
MenuPowerButton();
~MenuPowerButton();
+ sigc::signal<void> signal_menu_hide();
protected:
virtual void on_clicked() override;
+ sigc::signal<void> m_signal_menu_hide;
private:
Gtk::Image icon;
Gtk::Menu *menu;
+#ifdef POWER_DIALOG
+ Gtk::Window *dialog_;
+#endif
};
#endif // MENU_POWER_BUTTON_H
diff --git a/src/menu/menu-power-dialog.cpp b/src/menu/menu-power-dialog.cpp
new file mode 100644
index 0000000..1d75cf1
--- /dev/null
+++ b/src/menu/menu-power-dialog.cpp
@@ -0,0 +1,216 @@
+/**
+ * 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 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.
+ *
+ * Author: huangjiawen <huangjiawen@kylinos.com.cn>
+ */
+
+#include "menu-power-dialog.h"
+#include <glibmm/i18n.h>
+#include <gtk3-log-i.h>
+#include <gtkmm/menu.h>
+#include <iostream>
+#include "global.h"
+#include "kiran-helper.h"
+#include "kiran-power.h"
+
+MenuPowerDialog::MenuPowerDialog()
+{
+ Gtk::HeaderBar *dialog_header_bar;
+ Gtk::Frame *dialog_frame;
+ Gtk::Box *dialog_vbox;
+ Gtk::Box *dialog_hbox;
+ Gtk::Grid *dialog_grid;
+
+ dialog_header_bar = Gtk::make_managed<Gtk::HeaderBar>();
+ dialog_header_bar->set_decoration_layout("menu,icon:close");
+ dialog_header_bar->set_show_close_button();
+ set_titlebar(*dialog_header_bar);
+
+ set_modal();
+ set_title(_("Shutdown"));
+ set_border_width(5);
+ set_icon_name("kiran-power-shutdown");
+ set_position(Gtk::WIN_POS_CENTER);
+
+ dialog_frame = Gtk::make_managed<Gtk::Frame>();
+ dialog_frame->set_shadow_type(Gtk::SHADOW_OUT);
+ add(*dialog_frame);
+
+ Gdk::RGBA color;
+ color.set_rgba(0.20, 0.20, 0.20, 1);
+ dialog_header_bar->override_background_color(color, Gtk::STATE_FLAG_NORMAL);
+ dialog_frame->override_background_color(color, Gtk::STATE_FLAG_NORMAL);
+
+ dialog_vbox = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_VERTICAL);
+ dialog_vbox->set_border_width(20);
+ dialog_frame->add(*dialog_vbox);
+
+ dialog_hbox = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL);
+ dialog_hbox->set_border_width(35);
+ dialog_vbox->pack_start(*dialog_hbox, Gtk::PACK_EXPAND_PADDING);
+
+ dialog_grid = Gtk::make_managed<Gtk::Grid>();
+ dialog_grid->set_row_spacing(5);
+ dialog_grid->set_column_spacing(10);
+ dialog_hbox->pack_start(*dialog_grid, Gtk::PACK_EXPAND_PADDING);
+
+ add_power_button(dialog_grid);
+
+ get_style_context()->add_class("power-menu-dialog");
+}
+
+void MenuPowerDialog::add_power_button(Gtk::Grid *dialog_grid)
+{
+ gint space = 0;
+ auto power = KiranPower::get_default();
+
+ if (power->can_shutdown())
+ {
+ space += 1;
+ add_button("kiran-power-shutdown", "Shutdown", dialog_grid, space, &MenuPowerDialog::do_shutdown);
+ }
+
+ if (power->can_reboot())
+ {
+ space += 1;
+ add_button("kiran-power-reboot", "Reboot", dialog_grid, space, &MenuPowerDialog::do_reboot);
+ }
+
+ if (power->can_logout())
+ {
+ space += 1;
+ add_button("kiran-power-logout", "Logout", dialog_grid, space, &MenuPowerDialog::do_logout);
+ }
+
+ if (power->can_hibernate())
+ {
+ space += 1;
+ add_button("kiran-power-hibernate", "Hibernate", dialog_grid, space, &MenuPowerDialog::do_hibernate);
+ }
+
+ if (power->can_lock_screen())
+ {
+ space += 1;
+ add_button("kiran-power-lock_screen", "Lock screen", dialog_grid, space, &MenuPowerDialog::do_lock_screen);
+ }
+
+ if (power->can_switch_user())
+ {
+ space += 1;
+ add_button("kiran-power-switch_user", "Switch user", dialog_grid, space, &MenuPowerDialog::do_switch_user);
+ }
+
+ if (power->can_suspend())
+ {
+ space += 1;
+ add_button("kiran-power-suspend", "Suspend", dialog_grid, space, &MenuPowerDialog::do_suspend);
+ }
+}
+
+MenuPowerDialog::~MenuPowerDialog()
+{
+}
+
+void MenuPowerDialog::add_button(const char *button_icon_name,
+ const char *button_name,
+ Gtk::Grid *dialog_grid,
+ int space,
+ void (MenuPowerDialog::*power_func)())
+{
+ Gtk::Button *power_button;
+ Gtk::Label *power_label;
+
+ power_button = Gtk::make_managed<Gtk::Button>();
+ power_button->set_size_request(60, 40);
+ power_button->set_image_from_icon_name(button_icon_name, Gtk::ICON_SIZE_DND);
+ power_button->set_relief(Gtk::RELIEF_NONE);
+ power_button->signal_clicked().connect(sigc::mem_fun(*this, power_func));
+
+ dialog_grid->attach(*power_button, space, 0, 1, 1);
+
+ power_label = Gtk::make_managed<Gtk::Label>(_(button_name));
+ dialog_grid->attach(*power_label, space, 1, 1, 1);
+}
+
+void MenuPowerDialog::do_reboot()
+{
+ auto power = KiranPower::get_default();
+
+ power->reboot();
+
+ return;
+}
+
+void MenuPowerDialog::do_logout()
+{
+ auto power = KiranPower::get_default();
+
+ power->logout(LOGOUT_MODE_NOW);
+
+ return;
+}
+
+void MenuPowerDialog::do_shutdown()
+{
+ auto power = KiranPower::get_default();
+
+ power->shutdown();
+
+ return;
+}
+
+void MenuPowerDialog::do_hibernate()
+{
+ auto power = KiranPower::get_default();
+
+ power->hibernate();
+
+ return;
+}
+void MenuPowerDialog::do_suspend()
+{
+ auto power = KiranPower::get_default();
+
+ power->suspend();
+
+ return;
+}
+
+void MenuPowerDialog::do_switch_user()
+{
+ auto power = KiranPower::get_default();
+
+ if (power->get_graphical_ntvs() >= power->get_ntvs_total())
+ {
+ KLOG_DEBUG("Total ntvs: %d, graphical ntvs: %d.", power->get_ntvs_total(), power->get_graphical_ntvs());
+
+ Gtk::MessageDialog dialog(_("The logined users reach the maximum limit at the same time, "
+ "you cannot switch to the greeter interface, Please log off some logined users first."),
+ true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true);
+ dialog.set_title(_("System Warning"));
+ dialog.run();
+ }
+ else
+ {
+ power->switch_user();
+ }
+
+ return;
+}
+
+void MenuPowerDialog::do_lock_screen()
+{
+ auto power = KiranPower::get_default();
+
+ power->lock_screen();
+
+ return;
+}
diff --git a/src/menu/menu-power-dialog.h b/src/menu/menu-power-dialog.h
new file mode 100644
index 0000000..471ab42
--- /dev/null
+++ b/src/menu/menu-power-dialog.h
@@ -0,0 +1,43 @@
+/**
+ * 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 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.
+ *
+ * Author: huangjiawen <huangjiawen@kylinos.com.cn>
+ */
+
+#ifndef MENU_POWER_DIALOG_H
+#define MENU_POWER_DIALOG_H
+
+#include <gtkmm.h>
+#include "kiran-opacity-menu.h"
+
+class MenuPowerDialog : public Gtk::Window
+{
+public:
+ MenuPowerDialog();
+ ~MenuPowerDialog() override;
+ void do_shutdown();
+ void do_reboot();
+ void do_logout();
+ void do_lock();
+ void do_hibernate();
+ void do_suspend();
+ void do_switch_user();
+ void do_lock_screen();
+
+ void add_power_button(Gtk::Grid *dialog_grid);
+ void add_button(const char *button_icon_name,
+ const char *button_name,
+ Gtk::Grid *dialog_grid,
+ int space,
+ void (MenuPowerDialog::*power_func)());
+};
+
+#endif // MENU_POWER_DIALOG_H
--
2.33.0

View File

@ -1,33 +0,0 @@
From dc5e56b311f49532213a6a6445dc77e1f0cc4661 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Tue, 9 Aug 2022 10:49:36 +0800
Subject: [PATCH 2/2] fix(coredump): Fix the coredump problem caused by
nullpointer to UserIcon.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由于访问用户图标对象为空导致的崩溃问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/menu-avatar-widget.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/menu/menu-avatar-widget.cpp b/src/menu/menu-avatar-widget.cpp
index 194a55e..74f8c49 100644
--- a/src/menu/menu-avatar-widget.cpp
+++ b/src/menu/menu-avatar-widget.cpp
@@ -82,7 +82,8 @@ bool MenuAvatarWidget::on_draw(const ::Cairo::RefPtr<Cairo::Context> &cr)
auto radius = image_size / 2.0;
try
{
- pixbuf = Gdk::Pixbuf::create_from_file(user_info.get_iconfile(),
+ auto icon_file = user_info.get_iconfile();
+ pixbuf = Gdk::Pixbuf::create_from_file(icon_file ? icon_file : std::string(),
allocation.get_width() * scale,
allocation.get_height() * scale);
}
--
2.33.0

View File

@ -1,33 +0,0 @@
From 6ab073b0b84df6090368a320500b2c94438d6602 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 28 Jul 2022 11:10:22 +0800
Subject: [PATCH 2/2] fix(tray): Fix the problem that fcitx doesn't show in
tray area.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复fcitx没有在托盘区域中显示问题
Closes #I5HT13
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/tray/kiran-notify-icon.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/tray/kiran-notify-icon.h b/src/tray/kiran-notify-icon.h
index 02a5912..69b4f07 100644
--- a/src/tray/kiran-notify-icon.h
+++ b/src/tray/kiran-notify-icon.h
@@ -50,6 +50,7 @@ static const struct
{"Mate-volume-control-status-icon", "~02-volume", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
{"kiran-audio-status-icon", "~02-volume", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
{"ibus-ui-gtk", "~01-keyboard", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
+ {"Fcitx", "~01-keyboard", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
{"fcitx", "~01-keyboard", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
{"fcitx-qimpanel", "~01-keyboard", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
{"scim", "~01-keyboard", KIRAN_NOTIFY_ICON_CATEGORY_HARDWARE},
--
2.33.0

File diff suppressed because it is too large Load Diff

Binary file not shown.

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

Binary file not shown.

View File

@ -1,34 +1,15 @@
Name: kiran-menu
Version: 2.3.0
Release: 17
Version: 2.5.1
Release: 1
Summary: Applets for mate panel from Kiran Desktop
License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch1000: 0001-fix-menu-Fix-the-switch-user-error-by-xdmcp-logging.patch
Patch1001: 0001-fix-menu-Fix-the-problem-that-some-apps-are-show-rep.patch
Patch1002: 0002-fix-tray-Fix-the-problem-that-fcitx-doesn-t-show-in-.patch
Patch1003: 0001-fix-menu-fix-the-grab-problem-when-popup-menu-on-sea.patch
Patch1004: 0001-fix-connect-Fix-some-possible-crash-problems-caused-.patch
Patch1005: 0002-fix-coredump-Fix-the-coredump-problem-caused-by-null.patch
Patch1006: 0001-fix-coredump-Fix-the-coredump-problem-caused-by-Rece.patch
Patch1007: 0002-feature-gitlab-Add-.gitlab-ci.yml.patch
Patch1008: 0001-fix-tray-Fix-the-icon-location-error-when-system-res.patch
Patch1009: 0001-fix-tray-Fix-the-dbus-icon-can-not-scaled-when-syste.patch
Patch1010: 0001-feature-menu-Add-flat-class-for-button-to-keep-consi.patch
Patch1011: 0001-fix-menu-Fix-that-the-category-overlaps-the-search-b.patch
Patch1012: 0001-fix-tray-Fix-memory-leak-due-to-notification-area.patch
Patch1013: 0001-feature-menu-Add-pinyin-search-method-for-applicatio.patch
Patch1014: 0002-feature-menu-Add-UI-for-modal-power-options.patch
Patch1015: 0003-fix-translate-add-some-translation.patch
Patch1016: 0001-feature-menu-Hide-UI-after-click-on-the-power-option.patch
BuildRequires: cmake > 3.0
BuildRequires: gcc-c++
BuildRequires: gtkmm30-devel
BuildRequires: json-glib-devel
BuildRequires: json-glib-devel
BuildRequires: gettext
BuildRequires: libwnck3-devel
BuildRequires: kiran-cc-daemon-devel
@ -73,7 +54,12 @@ Redesigned panel applets for Mate Desktop
%autosetup -p1
%build
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF
%if "%{ks_custom_name}" == "GC"
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DPOWER_DIALOG:BOOL=ON
%else
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF
%endif
make %{?_smp_mflags}
@ -110,311 +96,14 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
%changelog
* Mon Apr 10 2023 huangjiawen <huangjiawen@kylinsec.om.cn> - 2.3.0-17
- KYOS-B:Hide UI after click on the power option
* Wed May 10 2023 tangjie02 <tangjie02@kylinsec.com.cn> - 2.5.1-1
- KYOS-F: replace suspend/hibernate/shutdown api with SessionManager.
* Mon Apr 10 2023 wangyucheng <wangyucheng@kylinsec.om.cn> - 2.3.0-16
- KYOS-T: add some translation
* Fri Apr 21 2023 huangjiawen <huangjiawen@kylinsec.com.cn> - 2.5.0-3
- KYOS-BHide UI after click on the power option
* Fri Apr 07 2023 huangjiawen <huangjiawen@kylinsec.com.cn> - 2.3.0-15
- KYOS-B: Add json-glib-devel build dependency.
* Fri Apr 07 2023 huangjiawen <huangjiawen@kylinsec.com.cn> - 2.3.0-14
- KYOS-B: Add pinyin search method for application.
- KYOS-B: Add UI for modal power options.
* Thu Dec 01 2022 wangxiaoqing <wangxiaoqing@kylinsec.com.cn> - 2.3.0-13
- KYOS-B: Fix memory leak due to notification area.(#I63Q6H)
* Tue Nov 15 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-12
- KYOS-B: Fix that the category overlaps the search box after the start menu collapses the category list.(I60PSI)
* Thu Oct 13 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-11
- KYOS-F: Add flat class for button to keep consistent with the color of color block.
* Tue Sep 06 2022 wangxiaoqing <wangxiaoqing@kylinsec.com.cn> - 2.3.0-10
- KYOS-B: Fix the dbus icon can not scaled when system scale changed.(#I5LQVE)
* Tue Aug 30 2022 wangxiaoqing <wangxiaoqing@kylinsec.com.cn> - 2.3.0-9
- KYOS-B: Fix the icon location error when system resolution change.
* Thu Aug 25 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-8
- KYOS-B: Fix the coredump problem caused by RecentFilesListBox::load
* Wed Aug 24 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-7
- KYOS-F: Add mate-search-tool to requires list
* Tue Aug 09 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-6
- KYOS-B: Fix the coredump problem caused by nullpointer to UserIcon.
- KYOS-B: Fix some possible crash problems caused by sigc::slot.
* Tue Aug 02 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-5
- KYOS-B: fix the grab problem when popup menu on search entry or drag menu app icon.
* Thu Jul 28 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-4
- KYOS-B: Fix the problem that fcitx doesn't show in tray area.(#I5HT13)
- KYOS-B: Fix the problem that some apps are show repeatly in start menu.(#I5HT8G)
* Tue Jul 19 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-3
- KYOS-B: Fix the switch user error by xdmcp logging.(#57865)
* Tue Jul 19 2022 yuanxing <yaunxing@kylinsec.com.cn> - 2.3.0-2
- KYOS-F: Do not output the alarm information to the screen
* Fri Jul 08 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-1
- KYOS-F: Update to version 2.3 and adapt new control panel.
* Wed Mar 09 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.6-7
- KYOS-F: Add fcitx to bottom panel.
* Wed Mar 02 2022 tangjie02 <tangjie02@kylinos.com.cn> - 2.2.6-6
- KYOS-F: Hide the search file tool on start menu.
* Wed Jan 12 2022 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.6-5.kb2
- rebuild for KY3.4-5-KiranUI-2.2
* Thu Dec 30 2021 kpkg <kpkg@kylinos.com.cn> - 2.2.6-5.kb1
- rebuild for KY3.4-MATE-modules-dev
* Wed Dec 29 2021 caoyuanji<caoyuanji@kylinos.com.cn> - 2.2.6-5
- Upgrade version number for easy upgrade
* Tue Dec 28 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.6-4.kb2
- rebuild for KY3.4-4-KiranUI-2.2
* Tue Dec 28 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.6-4.kb1
- rebuild for KY3.4-4-KiranUI-2.2
* Sat Dec 18 2021 wxq <wangxiaoqing@kylinos.com.cn> 2.2.6-4.ky3
- KYOS-B: Fix the get all cb func error when icon object free.
- KYOS-B: Cancel keyboard grab because it cause shortcut invalid.
* Tue Dec 07 2021 wxq <wangxiaoqing@kylinos.com.cn> 2.2.6-3.ky3
- KYOS-B: Fix the scrollbar color error in light gtk theme.
- KYOS-B: Modify the scroll bar css and distance.
* Fri Nov 19 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.6-2.ky3
- KYOS-B: not draw the icon hover status when popup menu.(#46026)
- KYOS-B: set the x11 icon colors property.(#46026)
* Fri Nov 19 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.6-1.ky3
- KYOS-F: Compatible KiranNew and KiranNew-dark theme.
- KYOS-F: Compatible kiran-screensaver.
- KYOS-B: The style of kiran-applets is changed with gtk theme.
* Fri Oct 29 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.5-6.ky3
- KYOS-B: Fix the zlog_ex.h dependency error.
* Mon Oct 25 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.5-5.ky3
- KYOS-F: Rebuild for KiranUI-2.1-OE
* Sat Oct 23 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.5-4.ky3
- KYOS-B: Revert: draw the background and the round window.
* Fri Oct 22 2021 yuanxing <yuanxing@kylinos.com.cn> 2.2.5-3.ky3
- KYOS-F: add create new workspace translation.(#45212)
- KYOS-B: Fix the coredump when press power button on start menu.
* Fri Oct 15 2021 xiewenhao <xiewenhao@kylinos.com.cn> 2.2.5-1.ky3.kb3
- KYOS-B: add cmake parameter #43502
* Sat Oct 09 2021 xiewenhao <xiewenhao@kylinos.com.cn> 2.2.5-1.ky3.kb2
- KYBD: rebuild for KiranUI-2.1-OE
* Sun Sep 26 2021 wangxiaoqing <wangxiaoqing@kylinos.com.cn> 2.2.5-1.ky3.kb1
- KYOS-F: draw the background and the round window.(#39692)
- KYOS-B: delete the gtk image set from pixbuf with scale function.(#39692)
- KYOS-B: realse the gsettings object when kiran tray finalize.(#44222)
* Fri Sep 17 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.5-1.ky3
- Modify the license to Mulan PSL.
* Wed Aug 25 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.4-1.ky3
- KYOS-F: Compatible kiran-panel.
* Wed Aug 04 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-6.ky3
- KYOS-B: Localization the tips name over tasklist application. (#42107)
* Tue Jul 20 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-5.ky3
- KYOS-B: Check whether system can shutdown when show power buttons.(#39572 #40713)
* Fri Jul 16 2021 wangxiaoqing <wangxiaoqing@kylinos.com.cn> 2.2.3-4.ky3.kb1
- KYOS-B: add the About menu translator.(#39692)
* Wed Jul 14 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-4.ky3
- KYOS-F: Add LICENSE file and copyright information in source file header.
- KYOS-F: Check whether system can shutdown or reboot when show power buttons. (#39572 #40713)
* Thu Jul 01 2021 wangxiaoqing <wangxiaoqing@kylinos.com.cn> 2.2.3-3.ky3.kb1
- KYOS-B: Not let panel applet to get key focus when mouse enter.(#39561)
* Tue Jun 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-3.ky3
- KYOS-F: Add new command(kiran-cpanel-account) for launching account manager.
* Sat Jun 19 2021 wangxiaoqing <wangxiaoqing@kylinos.com.cn> 2.2.3-2.ky3.kb1
- KYOS-B: let the kiran flameshot app status icon defaut in the panel.(#40001)
* Thu Jun 10 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-2.ky3
- KYOS-B: Fix the error that variable default-page in gsettings doesn't work.
- KYOS-F: rename gsettings name according to specification.
* Wed Jun 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-1.ky3.kb1
- KYOS-B: Delete the override-redirect property for menu window. (#39773)
* Thu Jun 03 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-1.ky3
- KYOS-F: Set default fixed applications which contain gnome-software, firfox, mate-terminal and caja on taskbar.
* Thu May 27 2021 wangxiaoqing <wangxiaoqing@kylinos.com.cn> 2.2.2-1.ky3
- KYOS-F: Add tray applet.
* Mon Mar 29 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1+beta1-2.ky3
- KYOS-F: Improve tranlations. (#36439)
- KYOS-B: Fix paging button visible when no apps opened. (#36444)
- KYOS-B: Fix disabled paging buttons style.
- KYOS-B: Grab keyboard for menu window after pop menu closed. (#36474)
* Thu Mar 25 2021 yuanxing <yuanxing@kylinos.com.cn> 2.2.1+beta1-1.ky3.kb1
- KYOS-F: [icons]change the icons of logo and workspace-switcher (#36338)
* Fri Mar 19 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1+beta1-1.ky3
- KYOS-F: new upstream source 2.2.1
* Thu Dec 24 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+beta1-1.ky3
- KYOS-F: [workspace] Fix user can use Alt+Tab to switch to other windows when switch window popup
- KYOS-F: Add support to write log messages to files
- KYOS-F: [workspace] Fix window thumbnails scaled too large
- KYOS-F: [workspace] Fix applet window size not update when screen size changed
- KYOS-F: [menu] Fix menu window hide delay when clicked app item
- KYOS-F: [workspace] Fix window thumbnails show only parts when screen size changed
- KYOS-F: [tasklist] Fix app button size not update when panel size changed
- KYOS-F: [menu, workspace] Fix applet button size not update when panel size changed
- KYOS-F: Update copyright in about dialogs of applets
- KYOS-F: [workspace] Fix windows thumbnails not reloaded when screen size changed in some cases
* Fri Nov 27 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha7-1.ky3
- KYOS-F: Use first window icon for app buttons that has no icon
- KYOS-F: deferred to check and toggle previewer
- KYOS-F: Fix crash for fixed apps that has no icon
- KYOS-F: Prohibit adding fake apps into favorites or fixed apps list
- KYOS-F: Fix crash when previewer window popup after applications reloaded
- KYOS-F: Fix application launched multiple times when press enter on items in search results
- KYOS-F: Fix menu window not hide when pressing ESC after popup from Super key
- KYOS-F: Fix menu window not hide when activate app from tasklist applet
- KYOS-F: Fix app button state not changed when windows count changed but not zero
- KYOS-F: Fix flatpak window matching application failure
- KYOS-F: Merge fake app by window wm_class property
* Wed Oct 28 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha6-1.ky3
- KYOS-F: Add about menuitem for applet context menus
- KYOS-F: Fix active app button not visible when start tasklist applet
- KYOS-F: Fix duplicated active app buttons when change active window the first time
- KYOS-F: Fix previewer window not hide when window thumbnail context menu closed
* Fri Oct 23 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha5-1.ky3
- KYOS-F: Scale app buttons before do paging when applet size is not sufficent
- KYOS-F: Change window minimize animation direction to app button
- KYOS-F: Add support for application startup notification
- KYOS-FFix window thumbnail not aligned center on HiDPI monitors
- KYOS-F: New algorithm for window thumbnail arrangement
* Wed Oct 14 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha4-1.ky3
- KYOS-F: Draw more indicators for apps that has more than one windows opened
- KYOS-F: Fix window thumbnail not in center position
- KYOS-F: Add support to scroll app buttons when applet space is not enough
- KYOS-F: Fix menu window not hide when click on window thumbnails
- KYOS-F: Fix crash when try to activate window that is minimized
- KYOS-F: Dont move previewer when context menu is opened for window thumbnails
- KYOS-F: Auto scroll to ensure the active app button is viewable
* Wed Oct 14 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha3-2.ky3
- KYOS-F: New icon for workspace switcher applet
- KYOS-F: Change filemanager launcher from caja-browser to caja in taskbar fixed apps
* Tue Sep 29 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha3-1.ky3
- KYOS-F: Fix tooltip and previewer both appear for apps fixed on taskbar (#30218)
- KYOS-F: Add task monitor launcher in sidebar for startmenu
- KYOS-F: Fix thumbnail missing when drag window thumbnail to it's workspace (#30265)
- KYOS-F: New icons for applets
* Fri Sep 25 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha2-1.ky3
- KYOS-F: Fix menu category file path error
* Thu Sep 24 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.2.0+alpha1-1.ky3
- KYBD: New upstream 2.2.0
* Fri Sep 18 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta7-1.ky3
- KYOS-F: Adjust power menu items according to mate desktop settings (#29094)
* Wed Sep 16 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta6-1.ky3
- KYOS-F: Auto switch to compact mode when screen is too small (#29837 #29270)
* Thu Aug 20 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta5-1.ky3
- KYOS-F: Activate the first app in results list when press enter key during search
- KYOS-F: Just do search when key pressed
- KYOS-F: Popup menu window when press super key
- KYOS-F: Add support to drag application items
- KYOS-B: Fix menu window not hide when new installed apps launched
* Mon Aug 03 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta4-2.ky3
- KYOS-P: Use old classic logo icon for start menu
* Mon Jul 27 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta4-1.ky3
- KYOS-P: Use new button icon for start menu
- KYOS-P: Use new lock icon
* Fri Jul 24 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta3-1.ky3
- KYOS-F: Fix panel button no display sometimes (#27933)
- KYOS-F: Load applications when idle
* Wed Jul 22 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta2-1.ky3
- KYOS-F: Hide apps that has 'X-KIRAN-NoDisplay' key in .desktop file (#28100)
* Wed Jul 22 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~beta1-1.ky3
- KYOS-F: Use Gtk::make_managed() api to replace Gtk::manage
- KYOS-F: Fix memory leak when remove widgets from parent
- KYOS-F: Use std::weak_ptr to store application object for application list
- KYOS-F: Wrap add app to desktop function as member instead of lambda
- KYOS-F: Fix build error on gtkmm30 < 3.24
* Fri Jul 10 2020 longcheng <longcheng@kylinos.com.cn> 2.1.0~alpha2-2.ky3.kb1
- KYOS-R: remove support for armv7hl
* Fri Jul 03 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~alpha2-2.ky3
- KYOS-F: Use expand mode as default display mode
* Tue Jun 30 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~alpha2-1.ky3
- KYOS-F: Fix ui styles on different gtk themes
- KYOS-F: Fix user avatar file not display when not set
- KYOS-F: Use the same font family for all widgets
- KYOS-F: Fix menu window always at monitor corner
- KYOS-F: Fix new installed apps not visible
- KYOS-F: Hide categories that has no apps
- KYOS-F: Make "New Installed" category focusable
- KYOS-F: Fix invalid loop when loadding applications list
- KYOS-F: Fix cransh when launch flatpak app
- KYOS-F: Add translations for search results page
- KYOS-F: Hide frequent apps box when no frequent apps available
- KYOS-F: Run mate-time-admin program when click date label
- KYOS-F: Use builtin icon for start menu button
- KYOS-F: Fix icon size too small for apps that has no icon set when scaled
- KYOS-F: Fix new installed apps list not change when new apps changed
- KYOS-F: Add support of display mode for menu window
- KYOS-F: Remove system-monitor and help launcher from sidebar
- KYOS-F: Fix scroll position not right when jump to category
* Mon Jun 22 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.1.0~alpha1-1.ky3
- KYOS-F: Rewrite with GTKMM
* Thu May 28 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha4-1.ky3
- KYOS-F: if app is flatpak, then launch directly app from Exec field and ignore DBusActivatable field in .desktop file
- KYOS-F: Fix crash with SIGSEGV signal when kill mate-panel
- KYOS-F: Auto resize menu window if its minimum size exceeds the screen size
- KYOS-F: Hide categories that has no apps
- KYOS-F: Fix crash when loading applications
- KYOS-F: Send all log data to syslog
* Tue May 19 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha3-1.ky3
- Initial source
* Thu Apr 13 2023 huangjiawen <huangjiawen@kylinsec.com.cn> - 2.5.0-2
- KYOS-BEnable modal power option.
* Thu Mar 16 2023 wangxiaoqing <wangxiaoqing@kylinsec.com.cn> - 2.5.0-1
- KYOS-B: Add pinyin search method for application.(#67099)