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 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions plugins/protocols/session-lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ class lock_crashed_node : public lock_base_node<simple_text_node_t>
set_size(output->get_screen_size());
}

void display()
void display(std::string text)
{
wf::cairo_text_t::params params(
1280 /* font_size */,
wf::color_t{0, 0, 0, 1} /* bg_color */,
wf::color_t{0.9, 0.9, 0.9, 1} /* fg_color */);
set_text_params(params);
// TODO: make the text smaller and display a useful message instead of a big explosion.
set_text("💥");
set_text(text);
auto layer_node = output->node_for_layer(wf::scene::layer::LOCK);
wf::scene::add_back(layer_node, shared_from_this());
wf::get_core().seat->set_active_node(shared_from_this());
Expand Down Expand Up @@ -253,7 +253,7 @@ class wf_session_lock_plugin : public wf::plugin_interface_t
output_states[output]->surface_node.reset();
if (output_states[output]->crashed_node)
{
output_states[output]->crashed_node->display();
output_states[output]->crashed_node->display("💥");
}
}

Expand Down Expand Up @@ -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("💥");
}

output->connect(&output_changed);
Expand Down Expand Up @@ -349,9 +349,11 @@ class wf_session_lock_plugin : public wf::plugin_interface_t
if (output_state->surface_node)
{
output_state->surface_node->display();
} else
{
// if the surface node has not yet been displayed we show an empty surface
output_state->crashed_node->display("");
}

// TODO: if the surface node has not yet been displayed, display... something?
}

void lock_all()
Expand Down
Loading