[][src]Module penrose::layout

Layouts are maintained per monitor and allow for indepent management of the two paramaters (n_main, main_ratio) that are used to modify layout logic. As penrose makes use of a tagging system as opposed to workspaces, layouts will be passed a Vec of clients to handle which is determined by the current client and monitor tags. arrange is only called if there are clients to handle so there is no need to check that clients.len() > 0. r is the monitor Region defining the size of the monitor for the layout to position windows.

Structs

Layout

A Layout is primarily a function that will be passed an array of client IDs to apply resize actions to. Only clients that should be tiled for the current monitor will be passed so no checks are required to see if each client should be handled. The region passed to the layout function represents the current screen dimensions that can be utilised and gaps/borders will be added to each client by the WindowManager itself so there is no need to handle that in the layouts themselves. Layouts are expected to have a 'main area' that holds the clients with primary focus and any number of secondary areas for the remaining clients to be tiled. The user can increase/decrease the size of the main area by setting 'ratio' via key bindings which should determine the relative size of the main area compared to other cliens. Layouts maintain their own state for number of clients in the main area and ratio which will be passed through to the layout function when it is called.

Enums

LayoutKind

Almost all layouts will be 'Normal' but penrose allows both for layouts that explicitly remove gaps and window borders and for floating layouts that do not apply resize actions to their windows. While it is possible to have multiple floating layouts, there isn't much point as kind == Floating disables calling through to the wrapped layout function.

Functions

client_breakdown

number of clients for the main area vs secondary

floating

A no-op floating layout that simply satisfies the type required for Layout

side_stack

A simple layout that places the main region on the left and tiles remaining windows in a single column to the right.