pub struct WindowLayout {
pub pos_in_scrolling_layout: Option<(usize, usize)>,
pub tile_size: (f64, f64),
pub window_size: (i32, i32),
pub tile_pos_in_workspace_view: Option<(f64, f64)>,
pub window_offset_in_tile: (f64, f64),
}
Expand description
Position- and size-related properties of a Window
.
Optional properties will be unset for some windows, do not rely on them being present. Whether some optional properties are present or absent for certain window types may change across niri releases.
All sizes and positions are in logical pixels unless stated otherwise. Logical sizes may be fractional. For example, at 1.25 monitor scale, a 2-physical-pixel-wide window border is 1.6 logical pixels wide.
This struct contains positions and sizes both for full tiles (Self::tile_size
,
Self::tile_pos_in_workspace_view
) and the window geometry (Self::window_size
,
Self::window_offset_in_tile
). For visual displays, use the tile properties, as they
correspond to what the user visually considers “window”. The window properties on the other
hand are mainly useful when you need to know the underlying Wayland window sizes, e.g. for
application debugging.
Fields§
§pos_in_scrolling_layout: Option<(usize, usize)>
Location of a tiled window within a workspace: (column index, tile index in column).
The indices are 1-based, i.e. the leftmost column is at index 1 and the topmost tile in a
column is at index 1. This is consistent with Action::FocusColumn
and
Action::FocusWindowInColumn
.
tile_size: (f64, f64)
Size of the tile this window is in, including decorations like borders.
window_size: (i32, i32)
Size of the window’s visual geometry itself.
Does not include niri decorations like borders.
Currently, Wayland toplevel windows can only be integer-sized in logical pixels, even though it doesn’t necessarily align to physical pixels.
tile_pos_in_workspace_view: Option<(f64, f64)>
Tile position within the current view of the workspace.
This is the same “workspace view” as in gradients’ relative-to
in the niri config.
window_offset_in_tile: (f64, f64)
Location of the window’s visual geometry within its tile.
This includes things like border sizes. For fullscreened fixed-size windows this includes the distance from the corner of the black backdrop to the corner of the (centered) window contents.
Trait Implementations§
Source§impl Clone for WindowLayout
impl Clone for WindowLayout
Source§fn clone(&self) -> WindowLayout
fn clone(&self) -> WindowLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more