Skip to content

Commit 1df5def

Browse files
committed
fix(dock): restore fashion mode monitor stats and mail card
Keep the fashion mode mail plugin visible without waking the mail client when no mailbox account is logged in, and read CPU and memory usage from /proc so the monitor plugin reports real values instead of stale fallback data. This snapshot also carries the REUSE and SPDX metadata updates required by the current CI checks for the touched files.
1 parent 61b4c67 commit 1df5def

212 files changed

Lines changed: 18273 additions & 2863 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,52 @@ if(Qt${QT_VERSION_MAJOR}_VERSION VERSION_GREATER_EQUAL 6.10)
5757
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WaylandClientPrivate WaylandCompositorPrivate REQUIRED)
5858
endif()
5959
find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui)
60+
set(ICU_USE_STATIC_LIBS OFF)
6061
find_package(ICU 74.2 REQUIRED COMPONENTS uc i18n io)
62+
63+
get_filename_component(DS_ICU_PREFIX "${ICU_INCLUDE_DIR}" DIRECTORY)
64+
function(ds_resolve_icu_shared_library output_var library_basename)
65+
set(search_roots
66+
"${DS_ICU_PREFIX}/lib"
67+
"${DS_ICU_PREFIX}/lib/*"
68+
"/usr/local/lib"
69+
"/usr/local/lib/*"
70+
"/usr/lib"
71+
"/usr/lib/*"
72+
"/lib"
73+
"/lib/*"
74+
)
75+
76+
foreach(search_root IN LISTS search_roots)
77+
file(GLOB versioned_candidates LIST_DIRECTORIES false "${search_root}/${library_basename}.so.*")
78+
list(SORT versioned_candidates)
79+
list(REVERSE versioned_candidates)
80+
81+
foreach(candidate IN LISTS versioned_candidates)
82+
get_filename_component(resolved_library "${candidate}" REALPATH)
83+
if (EXISTS "${resolved_library}")
84+
set(${output_var} "${resolved_library}" PARENT_SCOPE)
85+
return()
86+
endif()
87+
endforeach()
88+
89+
file(GLOB soname_candidates LIST_DIRECTORIES false "${search_root}/${library_basename}.so")
90+
foreach(candidate IN LISTS soname_candidates)
91+
get_filename_component(resolved_library "${candidate}" REALPATH)
92+
if (EXISTS "${resolved_library}")
93+
set(${output_var} "${resolved_library}" PARENT_SCOPE)
94+
return()
95+
endif()
96+
endforeach()
97+
endforeach()
98+
99+
message(FATAL_ERROR "Could not resolve an existing ICU shared library for ${library_basename}")
100+
endfunction()
101+
102+
ds_resolve_icu_shared_library(DS_ICU_UC_LIBRARY libicuuc)
103+
ds_resolve_icu_shared_library(DS_ICU_I18N_LIBRARY libicui18n)
104+
ds_resolve_icu_shared_library(DS_ICU_IO_LIBRARY libicuio)
105+
61106
find_package(WaylandProtocols REQUIRED)
62107
find_package(PkgConfig REQUIRED)
63108

LICENSES/OFL-1.1.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
SIL OPEN FONT LICENSE
2+
3+
Version 1.1 - 26 February 2007
4+
5+
PREAMBLE
6+
7+
The goals of the Open Font License (OFL) are to stimulate worldwide
8+
development of collaborative font projects, to support the font creation
9+
efforts of academic and linguistic communities, and to provide a free and
10+
open framework in which fonts may be shared and improved in partnership
11+
with others.
12+
13+
The OFL allows the licensed fonts to be used, studied, modified and
14+
redistributed freely as long as they are not sold by themselves. The
15+
fonts, including any derivative works, can be bundled, embedded,
16+
redistributed and/or sold with any software provided that any reserved
17+
names are not used by derivative works. The fonts and derivatives,
18+
however, cannot be released under any other type of license. The
19+
requirement for fonts to remain under this license does not apply to any
20+
document created using the fonts or their derivatives.
21+
22+
DEFINITIONS
23+
24+
"Font Software" refers to the set of files released by the Copyright
25+
Holder(s) under this license and clearly marked as such. This may
26+
include source files, build scripts and documentation.
27+
28+
"Reserved Font Name" refers to any names specified as such after the
29+
copyright statement(s).
30+
31+
"Original Version" refers to the collection of Font Software components as
32+
distributed by the Copyright Holder(s).
33+
34+
"Modified Version" refers to any derivative made by adding to, deleting,
35+
or substituting -- in part or in whole -- any of the components of the
36+
Original Version, by changing formats or by porting the Font Software to a
37+
new environment.
38+
39+
"Author" refers to any designer, engineer, programmer, technical
40+
writer or other person who contributed to the Font Software.
41+
42+
PERMISSION & CONDITIONS
43+
44+
Permission is hereby granted, free of charge, to any person obtaining a
45+
copy of the Font Software, to use, study, copy, merge, embed, modify,
46+
redistribute, and sell modified and unmodified copies of the Font
47+
Software, subject to the following conditions:
48+
49+
1) Neither the Font Software nor any of its individual components, in
50+
Original or Modified Versions, may be sold by itself.
51+
52+
2) Original or Modified Versions of the Font Software may be bundled,
53+
redistributed and/or sold with any software, provided that each copy
54+
contains the above copyright notice and this license. These can be
55+
included either as stand-alone text files, human-readable headers or in
56+
the appropriate machine-readable metadata fields within text or binary
57+
files as long as those fields can be easily viewed by the user.
58+
59+
3) No Modified Version of the Font Software may use the Reserved Font
60+
Name(s) unless explicit written permission is granted by the corresponding
61+
Copyright Holder. This restriction only applies to the primary font name
62+
as presented to the users.
63+
64+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
65+
Software shall not be used to promote, endorse or advertise any Modified
66+
Version, except to acknowledge the contribution(s) of the Copyright
67+
Holder(s) and the Author(s) or with their explicit written permission.
68+
69+
5) The Font Software, modified or unmodified, in part or in whole, must
70+
be distributed entirely under this license, and must not be distributed
71+
under any other license. The requirement for fonts to remain under this
72+
license does not apply to any document created using the Font Software.
73+
74+
TERMINATION
75+
76+
This license becomes null and void if any of the above conditions are not
77+
met.
78+
79+
DISCLAIMER
80+
81+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
82+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
83+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
84+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
85+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
86+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
87+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
88+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
89+
DEALINGS IN THE FONT SOFTWARE.

REUSE.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ precedence = "aggregate"
3333
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
3434
SPDX-License-Identifier = "GPL-3.0-or-later"
3535

36+
[[annotations]]
37+
path = ["panels/dock/package/SpotlightGradient.png", "panels/dock/package/SpotlightGradient.svg"]
38+
precedence = "aggregate"
39+
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
40+
SPDX-License-Identifier = "GPL-3.0-or-later"
41+
3642
[[annotations]]
3743
path = ["**.qrc", "**/qmldir"]
3844
precedence = "aggregate"
@@ -92,3 +98,9 @@ path = "toolGenerate/**/**"
9298
precedence = "aggregate"
9399
SPDX-FileCopyrightText = "None"
94100
SPDX-License-Identifier = "CC0-1.0"
101+
102+
[[annotations]]
103+
path = "shell/fonts/ElmsSans-Regular.ttf"
104+
precedence = "aggregate"
105+
SPDX-FileCopyrightText = "2025 The Elms Sans Project Authors"
106+
SPDX-License-Identifier = "OFL-1.1"

applets/dde-appearance/appearanceapplet.cpp

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -7,13 +7,24 @@
77
#include "pluginfactory.h"
88

99
#include <QDBusError>
10+
#include <QDBusMessage>
11+
#include <QDBusReply>
12+
#include <QDBusVariant>
1013
#include <QDebug>
1114
#include <QDBusServiceWatcher>
1215

1316
DCORE_USE_NAMESPACE
1417
DS_BEGIN_NAMESPACE
1518
namespace dde {
1619

20+
namespace {
21+
bool isOpacityChangeType(const QString &type)
22+
{
23+
return type.compare(QStringLiteral("opacity"), Qt::CaseInsensitive) == 0
24+
|| type.compare(QStringLiteral("windowopacity"), Qt::CaseInsensitive) == 0;
25+
}
26+
}
27+
1728
AppearanceApplet::AppearanceApplet(QObject *parent)
1829
: DApplet(parent)
1930
{
@@ -39,11 +50,11 @@ bool AppearanceApplet::load()
3950

4051
qreal AppearanceApplet::opacity() const
4152
{
42-
if (!m_interface)
53+
if (m_opacity < 0)
4354
return -1;
4455

4556
// The minimum opacity is 0.2
46-
return std::max(0.2, m_interface->opacity());
57+
return std::max(0.2, m_opacity);
4758
}
4859

4960
void AppearanceApplet::initDBusProxy()
@@ -59,11 +70,42 @@ void AppearanceApplet::initDBusProxy()
5970
return;
6071
}
6172

62-
m_interface->setSync(false);
63-
QObject::connect(m_interface.data(), &org::deepin::dde::Appearance1::OpacityChanged, this, &AppearanceApplet::opacityChanged);
73+
QObject::connect(m_interface.data(), &org::deepin::dde::Appearance1::Changed, this,
74+
[this](const QString &type, const QString &) {
75+
if (isOpacityChangeType(type)) {
76+
refreshOpacity();
77+
Q_EMIT opacityChanged();
78+
}
79+
});
80+
QObject::connect(m_interface.data(), &org::deepin::dde::Appearance1::Refreshed, this,
81+
[this](const QString &type) {
82+
if (isOpacityChangeType(type)) {
83+
refreshOpacity();
84+
Q_EMIT opacityChanged();
85+
}
86+
});
87+
refreshOpacity();
6488
Q_EMIT opacityChanged();
6589
}
6690

91+
void AppearanceApplet::refreshOpacity()
92+
{
93+
QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.deepin.dde.Appearance1"),
94+
QStringLiteral("/org/deepin/dde/Appearance1"),
95+
QStringLiteral("org.freedesktop.DBus.Properties"),
96+
QStringLiteral("Get"));
97+
message << QStringLiteral("org.deepin.dde.Appearance1") << QStringLiteral("Opacity");
98+
99+
QDBusReply<QDBusVariant> reply = QDBusConnection::sessionBus().call(message);
100+
if (!reply.isValid()) {
101+
qWarning() << "Failed to get Appearance opacity, error:" << reply.error();
102+
m_opacity = -1;
103+
return;
104+
}
105+
106+
m_opacity = reply.value().variant().toReal();
107+
}
108+
67109
D_APPLET_CLASS(AppearanceApplet)
68110
}
69111
DS_END_NAMESPACE

applets/dde-appearance/appearanceapplet.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -24,8 +24,10 @@ class AppearanceApplet : public DApplet
2424
void opacityChanged();
2525
private:
2626
void initDBusProxy();
27+
void refreshOpacity();
2728
private:
2829
QScopedPointer<org::deepin::dde::Appearance1> m_interface;
30+
qreal m_opacity = -1;
2931
};
3032

3133
}

applets/dde-apps/CMakeLists.txt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,46 @@ find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS DB
66
find_package(DDEApplicationManager REQUIRED)
77
find_package(yaml-cpp REQUIRED)
88

9+
set(DDE_APPS_DBUS_API_FALLBACK_DIR "${PROJECT_SOURCE_DIR}/panels/dock/taskmanager/api/amdbus")
10+
set(DDE_APPS_APPLICATION_XML "${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ApplicationManager1.Application.xml")
11+
set(DDE_APPS_APPLICATION_MANAGER_XML "${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ApplicationManager1.xml")
12+
set(DDE_APPS_OBJECT_MANAGER_XML "${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ObjectManager1.xml")
13+
14+
if (NOT EXISTS "${DDE_APPS_APPLICATION_XML}")
15+
set(DDE_APPS_APPLICATION_XML "${DDE_APPS_DBUS_API_FALLBACK_DIR}/org.desktopspec.ApplicationManager1.Application.xml")
16+
endif()
17+
18+
if (NOT EXISTS "${DDE_APPS_APPLICATION_MANAGER_XML}")
19+
set(DDE_APPS_APPLICATION_MANAGER_XML "${DDE_APPS_DBUS_API_FALLBACK_DIR}/org.desktopspec.ApplicationManager1.xml")
20+
endif()
21+
22+
if (NOT EXISTS "${DDE_APPS_OBJECT_MANAGER_XML}")
23+
set(DDE_APPS_OBJECT_MANAGER_XML "${DDE_APPS_DBUS_API_FALLBACK_DIR}/org.desktopspec.ObjectManager1.xml")
24+
endif()
25+
926
set_source_files_properties(
10-
${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ApplicationManager1.Application.xml
27+
${DDE_APPS_APPLICATION_XML}
1128
PROPERTIES INCLUDE api/types/am.h
1229
CLASSNAME Application
1330
)
1431

1532
set_source_files_properties(
16-
${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ApplicationManager1.xml
33+
${DDE_APPS_APPLICATION_MANAGER_XML}
1734
PROPERTIES INCLUDE api/types/am.h
1835
CLASSNAME ApplicationManager
1936
)
2037

2138
set_source_files_properties(
22-
${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ObjectManager1.xml
39+
${DDE_APPS_OBJECT_MANAGER_XML}
2340
PROPERTIES INCLUDE api/types/am.h
2441
CLASSNAME ObjectManager
2542
)
2643

2744
qt_add_dbus_interfaces(
2845
DBUS_INTERFACES
29-
${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ApplicationManager1.Application.xml
30-
${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ApplicationManager1.xml
31-
${DDE_APPLICATION_MANAGER_DBUS_API_DIR}/org.desktopspec.ObjectManager1.xml
46+
${DDE_APPS_APPLICATION_XML}
47+
${DDE_APPS_APPLICATION_MANAGER_XML}
48+
${DDE_APPS_OBJECT_MANAGER_XML}
3249
)
3350

3451

applets/dde-apps/appgroup.cpp

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -14,12 +14,15 @@ Q_LOGGING_CATEGORY(appGroupLog, "org.deepin.dde.shell.dde-apps.appgroup")
1414

1515
namespace apps {
1616
AppGroup::AppGroup(const QString &groupId, const QString &name, const QList<QStringList> &appIDs)
17-
: AppItem(groupId, AppItemModel::FolderItemType)
18-
, m_itemsPage(new ItemsPage(name, groupId == QStringLiteral("internal/folder/0") ? (4 * 8) : (3 * 4)))
17+
: AppItem(normalizeGroupId(groupId), AppItemModel::FolderItemType)
18+
, m_itemsPage(new ItemsPage(name, parseGroupId(groupId) == 0 ? (4 * 8) : (3 * 4)))
1919
{
2020
setItemsPerPage(m_itemsPage->maxItemCountPerPage());
2121
setAppName(m_itemsPage->name());
22-
// folder id is a part of its groupId: "internal/folder/{folderId}"
22+
QObject::connect(m_itemsPage, &ItemsPage::nameChanged, m_itemsPage, [this]() {
23+
setAppName(m_itemsPage->name());
24+
});
25+
// folder id is the numeric suffix of the normalized launcher group id.
2326
setFolderId(parseGroupId(groupId));
2427

2528
for (const QStringList &items : appIDs) {
@@ -49,19 +52,38 @@ ItemsPage *AppGroup::itemsPage()
4952

5053
bool AppGroup::idIsFolder(const QString & id)
5154
{
52-
return id.startsWith(QStringLiteral("internal/folder/"));
55+
bool isNumericId = false;
56+
id.toInt(&isNumericId);
57+
58+
return isNumericId ||
59+
id.startsWith(QStringLiteral("internal/folder/")) ||
60+
id.startsWith(QStringLiteral("internal/folders/")) ||
61+
id.startsWith(QStringLiteral("internal/group/"));
62+
}
63+
64+
QString AppGroup::normalizeGroupId(const QString &id)
65+
{
66+
bool isNumericId = false;
67+
const int numericId = id.toInt(&isNumericId);
68+
if (isNumericId) {
69+
return groupIdFromNumber(numericId);
70+
}
71+
72+
if (!idIsFolder(id)) {
73+
return id;
74+
}
75+
76+
return QStringLiteral("internal/folders/%1").arg(parseGroupId(id));
5377
}
5478

5579
QString AppGroup::groupIdFromNumber(int groupId)
5680
{
57-
return QStringLiteral("internal/folder/%1").arg(groupId);
81+
return QStringLiteral("internal/folders/%1").arg(groupId);
5882
}
5983

6084
int AppGroup::parseGroupId(const QString & id)
6185
{
62-
using namespace std::string_view_literals;
63-
constexpr size_t len = "internal/folder/"sv.size();
64-
return QStringView{id}.mid(len + 1).toInt();
86+
return id.section(QLatin1Char('/'), -1).toInt();
6587
}
6688

6789
void AppGroup::setItemsPerPage(int number)
@@ -75,4 +97,3 @@ void AppGroup::setFolderId(int folderId)
7597
}
7698

7799
}
78-

0 commit comments

Comments
 (0)