Module rs::panel

source · []
Expand description

Panel state management.

This is effectively a mirror of the previous C code, with an explicit state machine managing the panel size.

It still relies on a callback from Wayland to accept the panel size, which makes this code somewhat prone to mistakes.

An alternative to the callback would be to send a message all the way to state::State every time the allocated size changes. That would allow for a more holistic view of interactions of different pieces of state.

However, state::State already has the potential to become a ball of mud, tightly coupling different functionality and making it difficult to see independent units.

For this reason, I’m taking a light touch approach with the panel manager, and moving it just a bit closer to state::State. Hopefully ths still allows us to expose assumptions that were not stated yet (e.g. can the output disappear between size request andallocation?).

Tight coupling, e.g. a future one between presented hints and layout size, will have to be taken into account later.

Modules

Structs

Tries to contain all the panel sizing duties.

Size in pixels that is aware of scaling

Size 🔒

Enums

State 🔒

This state requests the Wayland layer shell protocol synchronization: the application asks for some size, and then receives a size that the compositor thought appropriate. Stores raw values passed to Wayland, i.e. scaled dimensions.

Update 🔒

A command to send out to the next layer of processing. Here, it’s the C side of the panel.

Functions

div_ceil 🔒