feat: enhance window effect support detection#685
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Sep 16, 2025
Merged
feat: enhance window effect support detection#68518202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
Added supportWindowEffect() function to check for both compositing and blur window capabilities Updated color picker button enable state to require both composite and blur window support Added connection to handle hasBlurWindowChanged signal for dynamic enable state updates This change ensures the color picker button is only enabled when both compositing and blur window effects are supported by the window manager, providing better user experience by preventing the button from being enabled in environments where the picker functionality wouldn't work properly due to missing window effects. Log: Color picker button now requires both compositing and blur window support to be enabled Influence: 1. Test color picker button enable/disable state when changing window manager compositing settings 2. Verify button state when blur window support is enabled/disabled 3. Test in environments with different window manager capabilities 4. Verify picker functionality works correctly when button is enabled feat: 增强窗口效果支持检测 新增 supportWindowEffect() 函数检查合成和模糊窗口支持能力 更新颜色选择器按钮启用状态,要求同时具备合成和模糊窗口支持 添加处理 hasBlurWindowChanged 信号的连接,实现动态启用状态更新 此更改确保颜色选择器按钮仅在窗口管理器同时支持合成和模糊窗口效果时启用, 提供更好的用户体验,防止在缺少窗口效果的环境中启用按钮而导致功能无法正常 工作。 Log: 颜色选择器按钮现在需要同时支持合成和模糊窗口效果才能启用 Influence: 1. 测试更改窗口管理器合成设置时颜色选择器按钮的启用/禁用状态 2. 验证模糊窗口支持启用/禁用时的按钮状态 3. 在不同窗口管理器能力的环境中进行测试 4. 验证按钮启用时选择器功能正常工作 PMS: BUG-329555
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Sep 16, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#685
Contributor
deepin pr auto review我对这段代码进行了审查,发现了一些可以改进的地方:
class DPrintPickColorWidget : public DWidget {
// ... 其他成员 ...
private:
DWindowManagerHelper *m_windowManagerHelper = nullptr; // 缓存窗口管理器实例
bool supportWindowEffect() const {
return m_windowManagerHelper &&
m_windowManagerHelper->hasComposite() &&
m_windowManagerHelper->hasBlurWindow();
}
};
// 在构造函数中初始化
DPrintPickColorWidget::DPrintPickColorWidget(QWidget *parent)
: DWidget(parent)
, pinterface(nullptr)
, m_windowManagerHelper(DWindowManagerHelper::instance())
{
// ... 其他初始化代码 ...
}
// 修改后的 initUI 和 initConnection
void DPrintPickColorWidget::initUI()
{
// ... 其他初始化代码 ...
pickColorBtn->setEnabled(supportWindowEffect());
// ... 其他代码 ...
}
void DPrintPickColorWidget::initConnection()
{
// ... 其他连接代码 ...
connect(m_windowManagerHelper, &DWindowManagerHelper::hasCompositeChanged, this, [this]() {
this->pickColorBtn->setEnabled(supportWindowEffect());
});
connect(m_windowManagerHelper, &DWindowManagerHelper::hasBlurWindowChanged, this, [this]() {
this->pickColorBtn->setEnabled(supportWindowEffect());
});
}
这些改进可以提高代码的性能、安全性和可维护性,同时保持原有功能的完整性。 |
mhduiy
approved these changes
Sep 16, 2025
18202781743
pushed a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Sep 16, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#685
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added supportWindowEffect() function to check for both compositing and
blur window capabilities
Updated color picker button enable state to require both composite and
blur window support
Added connection to handle hasBlurWindowChanged signal for dynamic
enable state updates
This change ensures the color picker button is only enabled when both
compositing and blur window effects are supported by the window manager,
providing better user experience by preventing the button from being
enabled in environments where the picker functionality wouldn't work
properly due to missing window effects.
Log: Color picker button now requires both compositing and blur window
support to be enabled
Influence:
manager compositing settings
feat: 增强窗口效果支持检测
新增 supportWindowEffect() 函数检查合成和模糊窗口支持能力
更新颜色选择器按钮启用状态,要求同时具备合成和模糊窗口支持
添加处理 hasBlurWindowChanged 信号的连接,实现动态启用状态更新
此更改确保颜色选择器按钮仅在窗口管理器同时支持合成和模糊窗口效果时启用,
提供更好的用户体验,防止在缺少窗口效果的环境中启用按钮而导致功能无法正常
工作。
Log: 颜色选择器按钮现在需要同时支持合成和模糊窗口效果才能启用
Influence:
PMS: BUG-329555