| 164 | } |
| 165 | |
| 166 | void display(std::string text) |
| 167 | { |
| 168 | if (!output) |
| 169 | { |
| 170 | LOGW("Trying to display crashed lock node on removed output"); |
| 171 | return; |
| 172 | } |
| 173 | |
| 174 | wf::cairo_text_t::params params( |
| 175 | 1280 /* font_size */, |
| 176 | wf::color_t{0, 0, 0, 1} /* bg_color */, |
| 177 | wf::color_t{0.9, 0.9, 0.9, 1} /* fg_color */); |
| 178 | set_text_params(params); |
| 179 | // TODO: make the text smaller and display a useful message instead of a big explosion. |
| 180 | set_text(text); |
| 181 | auto layer_node = output->node_for_layer(wf::scene::layer::LOCK); |
| 182 | if (parent() == nullptr) |
| 183 | { |
| 184 | wf::scene::add_back(layer_node, shared_from_this()); |
| 185 | } |
| 186 | |
| 187 | wf::get_core().seat->set_active_node(shared_from_this()); |
| 188 | } |
| 189 | |
| 190 | void display_crashed() |
| 191 | { |
nothing calls this directly
no test coverage detected