-
Notifications
You must be signed in to change notification settings - Fork 184
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
base: master
Are you sure you want to change the base?
Conversation
plugins/protocols/session-lock.cpp
Outdated
@@ -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("💥"); |
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.
Maybe we can define this emoji somewhere as a constant in order to not repeat it? :)
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.
Yes, makes sense -- I've added a separate function for it
3da867f
to
a644c23
Compare
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) |
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.
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 |
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.
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.
Minimal changes to hide the screen contents in this case as well.
Simple test client: https://github.com/dkondor/simple_lock