-
Notifications
You must be signed in to change notification settings - Fork 33
feat: implement ext-session-lock-v1 protocol support for waylib and treeland. #554
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
|
Hi @misaka18931. 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. |
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 there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/core/lockscreen.cpp:52` </location>
<code_context>
void LockScreen::shutdown()
{
+ // ext_session_lock_v1 does not support shutdown
+ if (!m_impl) {
+ qCCritical(treelandShell) << "Attempt to shutdown with no compatible lockscreen implementation!";
+ return;
+ }
</code_context>
<issue_to_address>
Critical log on missing lockscreen implementation may be too aggressive.
If missing lockscreen support is expected in some cases, consider using a lower log level or clarifying the message to prevent unnecessary alarm.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
if (!m_impl) {
qCCritical(treelandShell) << "Attempt to shutdown with no compatible lockscreen implementation!";
return;
}
=======
if (!m_impl) {
qCWarning(treelandShell) << "No compatible lockscreen implementation found during shutdown. This may be expected if lockscreen support is not available.";
return;
}
>>>>>>> REPLACE
</suggested_fix>
### Comment 2
<location> `src/seat/helper.cpp:1184` </location>
<code_context>
void Helper::activateSurface(SurfaceWrapper *wrapper, Qt::FocusReason reason)
{
- if (m_blockActivateSurface && wrapper) {
+ if (m_blockActivateSurface && wrapper && wrapper->type() != SurfaceWrapper::Type::LockScreen) {
if (wrapper->shellSurface()->hasCapability(WToplevelSurface::Capability::Activate)) {
workspace()->pushActivedSurface(wrapper);
</code_context>
<issue_to_address>
Excluding LockScreen from blockActivateSurface logic may have side effects.
Verify that focus cannot be changed when the lock screen is active, as this could compromise its intended security.
</issue_to_address>
### Comment 3
<location> `src/output/output.cpp:614` </location>
<code_context>
void Output::arrangeNonLayerSurface(SurfaceWrapper *surface, const QSizeF &sizeDiff)
{
+ if (surface->type() == SurfaceWrapper::Type::LockScreen) {
+ return;
+ }
</code_context>
<issue_to_address>
Skipping arrangeNonLayerSurface for LockScreen may cause layout inconsistencies.
Please verify that excluding LockScreen surfaces from layout management will not cause geometry or stacking problems, and ensure no visual artifacts are introduced.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Reviewer's GuideThis PR introduces full support for the Wayland ext-session-lock-v1 protocol. It adds a build-time flag, augments the core LockScreen and Helper classes to manage external session locks and their surfaces, implements the new protocol in Waylib’s server layer (with wrapper and QtQuick items), enhances the QML engine for a fallback UI, and updates the tinywl example to demonstrate the new flow. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ea80bc6 to
0ecacb7
Compare
|
TAG Bot New tag: 0.7.1 |
|
不好意思,这个改动要下周才能合入,本周要先冻结一个小版本出个tag,所以先暂存一下。 |
|
TAG Bot New tag: 0.7.2 |
cdf9fd1 to
900b81a
Compare
|
这个 CI fail 应该是来自这里,没有处理
|
|
TAG Bot New tag: 0.7.3 |
|
@misaka18931 这14个commit是要压到一起吗,还是保持着分开合入? |
如果要保持时分开,需要把中间穿插着的那些Merge的提交去掉,一般不进行merge操作,改为rebase操作。 |
|
我把它们压到一起吧,按最开始那样,按照 qwlroots, waylib, treeland 部分分成三个 commit 有必要吗? |
这倒无所谓,你来决定就行,分不分开都可以,分开的话,保证每个commit都是单独可编译通过的,且逻辑上自闭环,也就是要做到比较独立。 |
This commit exposes wlr_session_lock_v1_destroy as qw_session_lock_v1::destroy(), which allows the compositor to send finished() event on an ext_session_lock_v1 object. qw_session_lock_v1 objects are not the owner of their handles, thus cannot be properly destroyed via operator delete. Exposing the destroy() method as public is necessary. According to wayland protocol, compositor should have the ability to deny a session lock request.
This commit added the override specifier for waylandClient() and instantRelease() methods in class WLayerSurfacePirvate. waylandClient() is a virtual function in class WObjectPrivate, instantRelease() is a virtual function in clas WWrapObjectPrivate.
This commit adds support for the Wayland ext-session-lock-v1 protocol.
1. Added Class
- WSessionLockManager
- WSessionLock
- WSessionLockSurface
2. Implementation Details
Lifecycle of WSessionLock is managed by the WSessionLockManager.
Lifecycle of WSessionLockSurface is managed by its WSessionLock.
WSessionLock handles identification of all possible states a session lock
object can experiance, they are listed as follows:
- Created: default state
- Locked: session locked (after send_locked() is sent)
- Unlocked: client sent unlock_and_destroy()
- Finished: locking denyed by server sending finish()
- Canceled: lock destroyed by client before send_locked() is sent
- Abandoned: lock abnormally destroyed by client after locking
3. tinywl
An example usage is provided in the updated tinywl compositor.
This commit adds support for the ext-session-lock-v1 protocol to Treeland compositor. The implementation allows for a grace delay of 300ms for client to properly setup locking surfaces before sending locking. The implementation also disables animation for locking triggered by ext-session-lock-v1. When the lock is abandoned, if lockscreen plugin is loaded, treeland automaticly replace lock surfaces with that provided by the plugin. If else, the session will remain locked forever. Implementation Details: 1. lockscreen.cpp: extend the LockScreen class to handle locking initiated by WSessionLock object. 2. qmlengine: add a fallback LockScreen of solid grey color, in case if the locking client erronously deleted a lock surface before unlock. 3. treeland.cpp: allow loading the lockscreen plugin without DDM support. 4. output.cpp: allow session lock surfaces to ignore exclusive zones. 5. helper.cpp: attaches WSessionLockManager and handle screen lock logics. 6. surfacewrapper.cpp: added the LockScreen type to SurfaceWrapper
795fe6c to
45ce082
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: misaka18931 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 |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: misaka18931 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 |
|
把所有更改按照目的整合成了四个,原来的历史提交在 https://github.com/misaka18931/treeland/tree/ext_session_lock_v1_bak |
|
CLA Assistant Lite bot: |
This PR adds ext-session-lock-v1 protocol support to the Treeland compositor.
Changes in each commit is explained in its commit messages.
This PR implements session lock handling as follows:
Summary by Sourcery
Enable optional support for the Wayland ext-session-lock-v1 protocol across Waylib and the Treeland compositor, allowing external session lock requests to be handled as an alternative to DDM.
New Features:
Enhancements:
Build: