pub struct Window(pub u64);Expand description
A toplevel window.
A toplevel window is anything that can be stored within a container tile or within a floating window.
There are currently four types of windows:
- Containers
- Placeholders that take the place of a window when it goes fullscreen
- XDG toplevels
- X windows
You can find out the type of a window by using the Window::type_ function.
Tuple Fields§
§0: u64Implementations§
Source§impl Window
impl Window
Sourcepub fn does_not_exist(self) -> bool
pub fn does_not_exist(self) -> bool
Returns whether the window does not exist.
This is a shorthand for !self.exists().
Sourcepub fn client(self) -> Client
pub fn client(self) -> Client
Returns the client of the window.
If the window does not have a client, Client::exists return false.
Sourcepub fn type_(self) -> WindowType
pub fn type_(self) -> WindowType
Returns the type of the window.
Sourcepub fn content_type(self) -> ContentType
pub fn content_type(self) -> ContentType
Returns the content type of the window.
Sourcepub fn id(self) -> String
pub fn id(self) -> String
Returns the identifier of the window.
This is the identifier used in the ext-foreign-toplevel-list-v1 protocol.
Sourcepub fn is_visible(self) -> bool
pub fn is_visible(self) -> bool
Returns whether this window is visible.
Sourcepub fn parent(self) -> Window
pub fn parent(self) -> Window
Returns the parent of this window.
If this window has no parent, Window::exists returns false.
Sourcepub fn children(self) -> Vec<Window>
pub fn children(self) -> Vec<Window>
Returns the children of this window.
Only containers have children.
Sourcepub fn set_mono(self, mono: bool)
pub fn set_mono(self, mono: bool)
Sets whether the parent-container of the window is in mono-mode.
Sourcepub fn toggle_mono(self)
pub fn toggle_mono(self)
Toggles whether the parent-container of the window is in mono-mode.
Sourcepub fn toggle_split(self)
pub fn toggle_split(self)
Toggles the split axis of the parent-container of the window.
Sourcepub fn container_mono(self, target: ContainerTarget) -> bool
pub fn container_mono(self, target: ContainerTarget) -> bool
Returns whether the target container of the window is in mono-mode.
Sourcepub fn set_container_mono(self, target: ContainerTarget, mono: bool)
pub fn set_container_mono(self, target: ContainerTarget, mono: bool)
Sets whether the target container of the window is in mono-mode.
Sourcepub fn toggle_container_mono(self, target: ContainerTarget)
pub fn toggle_container_mono(self, target: ContainerTarget)
Toggles whether the target container of the window is in mono-mode.
Sourcepub fn container_split(self, target: ContainerTarget) -> Axis
pub fn container_split(self, target: ContainerTarget) -> Axis
Returns the split axis of the target container of the window.
Sourcepub fn set_container_split(self, target: ContainerTarget, axis: Axis)
pub fn set_container_split(self, target: ContainerTarget, axis: Axis)
Sets the split axis of the target container of the window.
Sourcepub fn toggle_container_split(self, target: ContainerTarget)
pub fn toggle_container_split(self, target: ContainerTarget)
Toggles the split axis of the target container of the window.
Sourcepub fn set_container_split_relative(
self,
target: ContainerTarget,
axis: RelativeAxis,
)
pub fn set_container_split_relative( self, target: ContainerTarget, axis: RelativeAxis, )
Sets the split axis of the target container of the window relative to the dimensions of that container.
Sourcepub fn create_split(self, axis: Axis)
pub fn create_split(self, axis: Axis)
Creates a new container with the specified split in place of the window.
If the window is the only child of its container and
set_split_reuses_container is enabled, the
split axis of that container is changed instead.
Sourcepub fn create_split_relative(self, axis: RelativeAxis)
pub fn create_split_relative(self, axis: RelativeAxis)
Creates a new container in place of the window with a split relative to the dimensions of that window.
If the window is the only child of its container and
set_split_reuses_container is enabled, the
split axis of that container is changed instead.
Sourcepub fn set_floating(self, floating: bool)
pub fn set_floating(self, floating: bool)
Sets whether the window is floating.
Sourcepub fn toggle_floating(self)
pub fn toggle_floating(self)
Toggles whether the window is floating.
You can do the same by double-clicking on the header.
Sourcepub fn workspace(self) -> Workspace
pub fn workspace(self) -> Workspace
Returns the workspace that this window belongs to.
If no such workspace exists, exists returns false for the returned workspace.
Sourcepub fn set_workspace(self, workspace: Workspace)
pub fn set_workspace(self, workspace: Workspace)
Moves the window to the workspace.
Sourcepub fn toggle_fullscreen(self)
pub fn toggle_fullscreen(self)
Toggles whether the currently focused window is fullscreen.
Sourcepub fn fullscreen(self) -> bool
pub fn fullscreen(self) -> bool
Returns whether the window is fullscreen.
Sourcepub fn set_fullscreen(self, fullscreen: bool)
pub fn set_fullscreen(self, fullscreen: bool)
Sets whether the window is fullscreen.
Sourcepub fn float_pinned(self) -> bool
pub fn float_pinned(self) -> bool
Gets whether the window is pinned.
If a floating window is pinned, it will stay visible even when switching to a different workspace.
Sourcepub fn set_float_pinned(self, pinned: bool)
pub fn set_float_pinned(self, pinned: bool)
Sets whether the window is pinned.
Sourcepub fn toggle_float_pinned(self)
pub fn toggle_float_pinned(self)
Toggles whether the window is pinned.
Sourcepub fn position(self) -> (i32, i32)
pub fn position(self) -> (i32, i32)
Returns the position of the window in the global compositor space.
This value is only accurate for visible windows.
Sourcepub fn size(self) -> (i32, i32)
pub fn size(self) -> (i32, i32)
Returns the size of the window.
This value is only accurate for visible windows.
Sourcepub fn theme(self) -> WindowTheme
pub fn theme(self) -> WindowTheme
Returns the theme overrides of this window.
See WindowTheme for details.
Sourcepub fn container_theme(self) -> ContainerTheme
pub fn container_theme(self) -> ContainerTheme
Returns the theme overrides of how this container decorates its children.
This is only supported for containers.
See ContainerTheme for details.