Expand description
Output-management client scaling a nested app compositor’s screens.
zwlr_output_management_v1 client: scales and arranges the screens of a
nested session compositor, in-process rather than through a wlr-randr fork.
Applications draw larger when the compositor they are on scales its own output. Scaling pixelflux’s capture output instead shrinks the logical size the session is handed, which upscales the desktop rather than enlarging its interface, so a DPI change for a nested session lands here.
A session that opens one screen per capture output (a wlroots compositor
under WLR_WL_OUTPUTS) arranges them by its own rule — side by side in the
order they were opened — and that layout, not the capture one, is what
places its windows and carries its pointer between screens. So the capture
arrangement is mirrored into it (set_screen_layout), read back
(list_screens), and the screens no capture output drives yet are held at a
token size (hold_spare_screens) so the desktop does not lay out across a
screen nobody sees. Screens are addressed by position in name order
(WL-1, WL-2, …), the order the session opened them in.
Compositors without the protocol report [ScaleOutcome::Unsupported] and
position nothing here; their scale comes from the capture output, which
they follow, and a KWin session’s arrangement lands through kdeclient
(kde_output_management_v2) instead. Blocking, off the compositor thread,
with every round-trip deadline-bounded.
Structs§
- Head 🔒
- An announced head with its name, enabled state, layout position, and scale.
- OutState 🔒
- Plan 🔒
- What a head is being asked to change; an unset field keeps its current value.
- Screen 🔒
- An enabled screen as a plan sees it: its head, logical position, current mode, and scale.
Enums§
- Config
Err 🔒 - Why a configuration did not land.
- Scale
Outcome - What a scale request did, from the caller’s point of view.
Constants§
- CONFIGURE_
BUDGET 🔒 - Rebuilds a canceled configuration until this much time is spent. A screen arriving or leaving cancels whatever is in flight, and that is the same moment a display’s mode and scale are being applied. Cancellations arrive in bursts, so the budget is a duration rather than a count of attempts: a count that outlasts a burst on one machine is spent inside one on a busier machine, where the attempts slow down and the burst does not. It can be generous because the caller is off the event loop with the GIL released, while giving up leaves the display on a capture-side scale until something asks again.
Functions§
- close_
gaps 🔒 - Rectangles arranged in one space, each about to take a new size: the same arrangement in the space of the new sizes. One whose edge met another’s far edge meets it still; every other coordinate is kept. A session places its screens in its logical space, where a scaled screen is smaller than its mode, so an arrangement stated in capture pixels closes up around it here, and a screen changing scale carries its neighbors with it.
- configure 🔒
- Apply
planto the compositor’s enabled screens, retrying while the compositor cancels.planreceives them in screen order and answers with the heads to change; heads it leaves out keep their configuration. It is called once per attempt, against the screens of that attempt. 0 = the compositor manages no outputs, or the plan asked for nothing. - configure_
once 🔒 - One attempt: a connection of its own, the heads and the serial that
stamps them, and
planapplied against that state. A retry reconnects rather than waiting for a fresh serial on the one it has, because the change that canceled it is often a head arriving or leaving, and the heads a kept connection holds do not survive that. - hold_
spare_ screens - Hold every screen past the first
keepatsize. A session compositor opens the screens it was started with whether or not anything watches them, and one held at a real screen’s size stretches the session’s coordinate space onto a screen nobody sees. Returns how many were resized. - list_
screens - The session’s enabled screens as
(name, x, y, width, height), in screen order — what the compositor actually did with a layout and a mode, which is not always what it was asked for. A head carries no size itself, so the size is its current mode’s;(0, 0)where it announced none. Empty when the compositor manages no outputs for clients. - logical_
size 🔒 - The logical size wlroots gives a mode at a scale (each axis truncated).
- rescale 🔒
- The plan that gives screen
indexa scale, and the mode asked for, and closes the others up around the logical size it takes. - set_
output_ scale - Set the scale of the
index-th screen of the compositor onsocket_path, leaving its mode and position alone. Blocking; call off the compositor’s calloop thread. - set_
screen_ geometry - Give the
index-th screen of the compositor onsocket_paththis mode and scale in one configuration. - set_
screen_ layout - Lay the session’s screens out at
rects, one(x, y, width, height)per screen in screen order, so its own layout matches the arrangement the capture outputs were placed in. - trailing_
number 🔒 - The number a screen’s name ends in (WL-2 -> 2), or none, which sorts first.