Skip to content

WIP cosmic-session-lock-layer-v1 protocol - #2792

Draft
ids1024 wants to merge 1 commit into
masterfrom
session-lock-layer
Draft

WIP cosmic-session-lock-layer-v1 protocol#2792
ids1024 wants to merge 1 commit into
masterfrom
session-lock-layer

Conversation

@ids1024

@ids1024 ids1024 commented Aug 28, 2026

Copy link
Copy Markdown
Member

A very rough draft of an implementation of a protocol to allow cosmic-bg to be shown on the lock-screen.

This could also be used by the panel, but we'll also need another protocol to notify the panel that the session is locked so it can hide applets that shouldn't be shown on the lock screen, and propagate that information to applets. That is more subtle to get right.

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

ids1024 added a commit to pop-os/cosmic-bg that referenced this pull request Sep 8, 2026
@hojjatabdollahi

hojjatabdollahi commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

I tried this with glowberry. But it doesn't redraw. Looks like it's short circuiting:

cosmic-comp/src/shell/mod.rs

Lines 2049 to 2055 in bb5f8b7

if let Some(session_lock) = &self.session_lock {
return session_lock
.surfaces
.iter()
.find(|(_, v)| v.wl_surface() == surface)
.map(|(k, _)| k);
}

It needs to handle show-on-lock layer:

        if let Some(session_lock) = &self.session_lock {
            if let Some(output) = session_lock
                .surfaces
                .iter()
                .find(|(_, v)| v.wl_surface() == surface)
                .map(|(k, _)| k)
            {
                return Some(output);
            }
            // schedule redraw for commits by show-on-lock layers
            return self.outputs().find(|o| {
                layer_map_for_output(o)
                    .layer_for_surface(surface, WindowSurfaceType::ALL)
                    .is_some_and(|l| layer_show_on_lock(l.wl_surface()))
            });
        }
recording-2026-09-08_17-36-53-trimmed.mp4

@ids1024

ids1024 commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

Yeah, there are a couple places that iterate over surfaces that still need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants