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

Method configure

src/view/layer-shell/layer-shell.cpp:602–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602void wayfire_layer_shell_view::configure(wf::geometry_t box)
603{
604 auto state = &lsurface->current;
605 if ((state->anchor & both_horiz) == both_horiz)
606 {
607 box.x += state->margin.left;
608 box.width -= state->margin.left + state->margin.right;
609 } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT))
610 {
611 box.x += state->margin.left;
612 } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT))
613 {
614 box.x -= state->margin.right;
615 }
616
617 if ((state->anchor & both_vert) == both_vert)
618 {
619 box.y += state->margin.top;
620 box.height -= state->margin.top + state->margin.bottom;
621 } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP))
622 {
623 box.y += state->margin.top;
624 } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM))
625 {
626 box.y -= state->margin.bottom;
627 }
628
629 if ((box.width < 0) || (box.height < 0))
630 {
631 LOGE("layer-surface has calculated width and height < 0");
632 close();
633 }
634
635 // TODO: transactions here could make sense, since we want to change x,y,w,h together, but have to wait
636 // for the client to resize.
637 move(box.x, box.y);
638 wlr_layer_surface_v1_configure(lsurface, box.width, box.height);
639}
640
641void wayfire_layer_shell_view::remove_anchored(bool reflow)
642{

Callers 1

pin_viewMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected