-
Notifications
You must be signed in to change notification settings - Fork 16
fix: fix treeland-protocol name #65
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
Conversation
treeland_ddm is renamed to treeland_ddm_v1, adapt this change.
|
Hi @calsys456. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates TreelandConnector to use the renamed Wayland protocol interface Updated class diagram for TreelandConnector using treeland_ddm_v1classDiagram
class TreelandConnector {
+TreelandConnector()
+~TreelandConnector()
+bool isConnected()
+void setPrivateObject(treeland_ddm_v1* ddm)
+void setSignalHandler()
+void connect(QString socketPath)
+void switchToGreeter()
+void switchToUser(QString username)
+void activateSession()
+void deactivateSession()
+void enableRender()
+wl_callback* disableRender()
-wl_display* m_display
-QSocketNotifier* m_notifier
-treeland_ddm_v1* m_ddm
}
class treeland_ddm_v1 {
+void switch_to_greeter()
+void switch_to_user(const char* username)
+void activate_session()
+void deactivate_session()
+void enable_render()
+wl_callback* disable_render()
}
class treeland_ddm_v1_listener {
+void switch_to_vt(void* data, treeland_ddm_v1* ddm, int32_t vtnr)
+void acquire_vt(void* data, treeland_ddm_v1* ddm, int32_t vtnr)
}
TreelandConnector --> treeland_ddm_v1 : uses
treeland_ddm_v1_listener --> treeland_ddm_v1 : listens_to
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 - I've found 1 issue, and left some high level feedback:
- In
registerGlobal, you still compareinterfaceagainst the literal "treeland_ddm" even though you're now bindingtreeland_ddm_v1; confirm whether the advertised interface name also changed and update the string if needed to avoid missing the global. - The debug message "Connected to treeland_ddm global object" is now out of sync with the protocol name; consider updating it to reflect
treeland_ddm_v1for clarity when debugging.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `registerGlobal`, you still compare `interface` against the literal "treeland_ddm" even though you're now binding `treeland_ddm_v1`; confirm whether the advertised interface name also changed and update the string if needed to avoid missing the global.
- The debug message "Connected to treeland_ddm global object" is now out of sync with the protocol name; consider updating it to reflect `treeland_ddm_v1` for clarity when debugging.
## Individual Comments
### Comment 1
<location> `src/daemon/TreelandConnector.cpp:156` </location>
<code_context>
-static void switchToVt([[maybe_unused]] void *data, [[maybe_unused]] struct treeland_ddm *ddm, int32_t vtnr) {
+static void switchToVt([[maybe_unused]] void *data, [[maybe_unused]] struct treeland_ddm_v1 *ddm, int32_t vtnr) {
int fd = open(qPrintable(VirtualTerminal::path(vtnr)), O_RDWR | O_NOCTTY);
if (ioctl(fd, VT_ACTIVATE, vtnr) < 0)
qWarning("Failed to switch to VT %d: %s", vtnr, strerror(errno));
</code_context>
<issue_to_address>
**issue (bug_risk):** Handle `open` failures before using the file descriptor in the VT helpers.
`open` may fail in both `switchToVt` and `acquireVt`, but its return value is used without checking for `< 0`. This means `ioctl`, `VirtualTerminal::handleVtSwitches`, and `close` can be called with an invalid FD. Please add a check for `fd < 0` and return or log appropriately before using the descriptor.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| static void switchToVt([[maybe_unused]] void *data, [[maybe_unused]] struct treeland_ddm *ddm, int32_t vtnr) { | ||
| static void switchToVt([[maybe_unused]] void *data, [[maybe_unused]] struct treeland_ddm_v1 *ddm, int32_t vtnr) { | ||
| int fd = open(qPrintable(VirtualTerminal::path(vtnr)), O_RDWR | O_NOCTTY); |
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): Handle open failures before using the file descriptor in the VT helpers.
open may fail in both switchToVt and acquireVt, but its return value is used without checking for < 0. This means ioctl, VirtualTerminal::handleVtSwitches, and close can be called with an invalid FD. Please add a check for fd < 0 and return or log appropriately before using the descriptor.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: calsys456, zccrs 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 |
|
obs构建失败是因为treeland协议在obs的构建环境中未更新,这个失败无法避免。 |
treeland_ddm is renamed to treeland_ddm_v1, adapt this change.
Summary by Sourcery
Bug Fixes: