| 533 | } |
| 534 | |
| 535 | void wayfire_layer_shell_view::commit() |
| 536 | { |
| 537 | wf::dimensions_t new_size{lsurface->surface->current.width, lsurface->surface->current.height}; |
| 538 | if (new_size != wf::dimensions(geometry)) |
| 539 | { |
| 540 | this->geometry.width = new_size.width; |
| 541 | this->geometry.height = new_size.height; |
| 542 | wf::scene::damage_node(get_root_node(), last_bounding_box); |
| 543 | } |
| 544 | |
| 545 | this->last_bounding_box = get_bounding_box(); |
| 546 | |
| 547 | auto state = &lsurface->current; |
| 548 | /* Update the keyboard focus enabled state. If a refocusing is needed, i.e |
| 549 | * the view state changed, then this will happen when arranging layers */ |
| 550 | keyboard_focus_enabled = state->keyboard_interactive; |
| 551 | |
| 552 | if (state->committed) |
| 553 | { |
| 554 | /* Update layer manually */ |
| 555 | if (prev_state.layer != state->layer) |
| 556 | { |
| 557 | wf::scene::readd_front(get_output()->node_for_layer(get_layer()), get_root_node()); |
| 558 | /* Will also trigger reflowing */ |
| 559 | wf_layer_shell_manager::get_instance().handle_move_layer(this); |
| 560 | } else |
| 561 | { |
| 562 | /* Reflow reserved areas and positions */ |
| 563 | wf_layer_shell_manager::get_instance().arrange_layers(get_output()); |
| 564 | } |
| 565 | |
| 566 | if (prev_state.keyboard_interactive != state->keyboard_interactive) |
| 567 | { |
| 568 | if ((state->keyboard_interactive == 1) && (state->layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP)) |
| 569 | { |
| 570 | wf::get_core().seat->focus_view(self()); |
| 571 | } else if (state->keyboard_interactive == 0) |
| 572 | { |
| 573 | wf::get_core().seat->refocus(); |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | prev_state = *state; |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | void wayfire_layer_shell_view::set_output(wf::output_t *output) |
| 582 | { |
nothing calls this directly
no test coverage detected