-
Notifications
You must be signed in to change notification settings - Fork 59
sync: from linuxdeepin/dde-session-shell #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Reviewer's GuideThis PR syncs source from linuxdeepin/dde-session-shell, adding automatic keyboard layout switching on the lock screen for special layouts and improving inhibitor warning view icon resolution via DesktopSpec integration. Sequence Diagram for Keyboard Layout Management at LoginsequenceDiagram
actor User
participant LockContent
participant OS_Keyboard_Settings
LockContent->>LockContent: init(model)
alt Login Screen and Special Keyboard Layout is detected
LockContent->>LockContent: keyboardLayoutHasSpecialSetting() returns true
LockContent->>OS_Keyboard_Settings: getCurrentKBLayoutAndVariant()
activate OS_Keyboard_Settings
OS_Keyboard_Settings-->>LockContent: originalLayout
deactivate OS_Keyboard_Settings
LockContent->>LockContent: store originalLayout in m_originalKBLayout
LockContent->>OS_Keyboard_Settings: setKBLayoutAndVariant("us")
activate OS_Keyboard_Settings
OS_Keyboard_Settings-->>LockContent: success
deactivate OS_Keyboard_Settings
end
User->>LockContent: Authenticates
LockContent->>LockContent: authFinished(successful=true)
alt Original Layout Was Saved (m_originalKBLayout is not empty)
LockContent->>OS_Keyboard_Settings: setKBLayoutAndVariant(m_originalKBLayout)
activate OS_Keyboard_Settings
OS_Keyboard_Settings-->>LockContent: success
deactivate OS_Keyboard_Settings
end
LockContent->>User: Login successful, UI updated
Sequence Diagram for D-Bus Based Icon Fetching in InhibitWarnViewsequenceDiagram
participant IWV as InhibitWarnView
participant DSGA as DSGApplication
participant AMS as "AppManager Service (D-Bus)"
Note over IWV: In setInhibitorList, for inhibitor with no icon & ENABLE_DSS_SNIPE
IWV->>DSGA: getId(pid)
activate DSGA
DSGA-->>IWV: appId
deactivate DSGA
opt appId is valid
IWV->>AMS: GetProperty("Icons") via DDBusSender
activate AMS
AMS-->>IWV: iconsData (QMap)
deactivate AMS
IWV->>IWV: iconName = iconsData.value("Desktop Entry")
end
Updated Class Diagram for LockContentclassDiagram
class LockContent {
-m_originalKBLayout : QString
+init(model: SessionBaseModel*) : void
+initConnections() : void
+keyboardLayoutHasSpecialSetting() : bool
+getCurrentKBLayoutAndVariant() : QString
+setKBLayoutAndVariant(layoutVariant: const QString &) : void
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @deepin-ci-robot - I've reviewed your changes - here's some feedback:
- Avoid blocking the UI thread with synchronous QProcess calls for setxkbmap and -query; consider using asynchronous processes or startDetached to prevent freezes.
- In InhibitWarnView you shadow
iconName
inside the nested block, which can lead to empty or incorrect icons—use a single variable scope to accumulate the icon name instead.
Here's what I looked at during the review
- 🟡 General issues: 4 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/widgets/inhibitwarnview.cpp
Outdated
if (executable_info.exists()) { | ||
icon = QIcon::fromTheme(executable_info.fileName()); | ||
// 玲珑应用的exe指向的路径是容器内的路径,在容器外无法访问,因此不能判断文件是否存在 | ||
QString iconName = executable_info.fileName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Remove redundant redeclaration of iconName to avoid shadowing
The inner declaration creates a new variable, so the filename isn't assigned to the outer iconName. Use 'iconName =' instead to update the existing variable.
src/widgets/inhibitwarnview.cpp
Outdated
@@ -86,16 +98,41 @@ | |||
for (const InhibitorData &inhibitor : list) { | |||
QIcon icon; | |||
|
|||
if (inhibitor.icon.isEmpty() && inhibitor.pid) { | |||
if (inhibitor.icon.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Restore inhibitor.pid
check to maintain correct fallback behavior
Without the pid
check, cases with an empty PID may bypass the fallback logic, resulting in no icon. Please restore the && inhibitor.pid
condition.
if (inhibitor.icon.isEmpty()) { | |
if (inhibitor.icon.isEmpty() && inhibitor.pid) { |
{ | ||
QProcess p; | ||
p.start("/usr/bin/setxkbmap", {"-query"}); | ||
p.waitForFinished(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Add a timeout and error check to waitForFinished
Using waitForFinished()
without a timeout can cause the process to hang if it stalls. Please use the timeout overload and check the process exit status and standard error to handle possible failures.
return variant.isEmpty() ? layout : layout + "+" + variant; | ||
} | ||
|
||
void LockContent::setKBLayoutAndVariant(const QString &layoutVariant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Validate layoutVariant
parts before invoking setxkbmap
Sanitize each part of layoutVariant
to ensure only valid values are passed to setxkbmap
, and check for exactly one +
separator.
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#10
deepin pr auto review关键摘要:
是否建议立即修改: |
TAG Bot New tag: 6.0.39 |
TAG Bot New tag: 6.0.40 |
TAG Bot New tag: 6.0.41 |
TAG Bot New tag: 6.0.42 |
TAG Bot New tag: 6.0.43 |
Synchronize source files from linuxdeepin/dde-session-shell.
Source-pull-request: linuxdeepin/dde-session-shell#10
Summary by Sourcery
Incorporate upstream session-shell enhancements to temporarily switch to a default US keyboard layout on the login screen when a custom layout is detected and to improve inhibitor warning icons by fetching them via the desktop-specific DBus service with fallbacks.
Enhancements: