Skip to content
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

session-lock: lock the screen even if the client provides no lock surface #2550

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dkondor
Copy link
Contributor

@dkondor dkondor commented Dec 27, 2024

Minimal changes to hide the screen contents in this case as well.

Simple test client: https://github.com/dkondor/simple_lock

@@ -318,7 +318,7 @@ class wf_session_lock_plugin : public wf::plugin_interface_t
if (state == ZOMBIE)
{
output->set_inhibited(true);
output_states[output]->crashed_node->display();
output_states[output]->crashed_node->display("💥");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can define this emoji somewhere as a constant in order to not repeat it? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, makes sense -- I've added a separate function for it

@dkondor
Copy link
Contributor Author

dkondor commented Feb 15, 2025

I've also realized after some re-testing that this does not work if a screenlocker crashes without ever displaying a surface. The last commit takes care of this (let me know if you prefer a different approach though)

auto layer_node = output->node_for_layer(wf::scene::layer::LOCK);
wf::scene::add_back(layer_node, shared_from_this());
if (!is_displayed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an additional bool variable for this? AFAICT all you want to know is whether the node has alraedy been added to the scenegraph. You could do that by checking whether its parent is NULL.

{
output_state->surface_node->display();
} else
{
// if the surface node has not yet been displayed we show an empty surface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we hide the crashed node once the actual lock node is there? I think for example if one wanted to implement a blurred lockscreen, or animate the lockscreen surface, this would prevent it from working.

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