MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / commit

Method commit

src/view/layer-shell/layer-shell.cpp:535–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535void 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
581void wayfire_layer_shell_view::set_output(wf::output_t *output)
582{

Callers

nothing calls this directly

Calls 7

damage_nodeFunction · 0.85
readd_frontFunction · 0.85
node_for_layerMethod · 0.80
handle_move_layerMethod · 0.80
arrange_layersMethod · 0.80
focus_viewMethod · 0.80
refocusMethod · 0.45

Tested by

no test coverage detected