[][src]Struct penrose::core::manager::WindowManager

pub struct WindowManager<'a> { /* fields omitted */ }

WindowManager is the primary struct / owner of the event loop for penrose. It handles most (if not all) of the communication with XCB and responds to X events served over the embedded connection. User input bindings are parsed and bound on init and then triggered via grabbed X events in the main loop along with everything else.

Implementations

impl<'a> WindowManager<'a>[src]

pub fn init(config: Config<'_>, conn: &'a dyn XConn) -> WindowManager<'a>[src]

Initialise a new window manager instance using an existing connection to the X server.

pub fn grab_keys_and_run(
    &mut self,
    bindings: KeyBindings,
    mouse_bindings: MouseBindings
)
[src]

main event loop for the window manager. Everything is driven by incoming events from the X server with each event type being mapped to a handler

pub fn detect_screens(&mut self)[src]

Reset the current known screens based on currently detected outputs

pub fn log(&self, msg: &str)[src]

Log information out at INFO level for picking up by external programs

pub fn cycle_screen(&mut self, direction: Direction)[src]

Cycle between known screens. Does not wrap from first to last

pub fn cycle_workspace(&mut self, direction: Direction)[src]

Cycle between workspaces on the current Screen. This will pull workspaces to the screen if they are currently displayed on another screen.

pub fn drag_workspace(&mut self, direction: Direction)[src]

Move the currently focused workspace to the next Screen in 'direction'

pub fn cycle_client(&mut self, direction: Direction)[src]

Cycle between Clients for the active Workspace

pub fn rotate_clients(&mut self, direction: Direction)[src]

Rotate the client stack on the active Workspace

pub fn drag_client(&mut self, direction: Direction)[src]

Move the focused Client through the stack of Clients on the active Workspace

pub fn cycle_layout(&mut self, direction: Direction)[src]

Cycle between Layouts for the active Workspace

pub fn update_max_main(&mut self, change: Change)[src]

Increase or decrease the number of clients in the main area by 1

pub fn update_main_ratio(&mut self, change: Change)[src]

Increase or decrease the current Layout main_ratio by main_ratio_step

pub fn exit(&mut self)[src]

Shut down the WindowManager, running any required cleanup and exiting penrose

pub fn current_layout_symbol(&self) -> &str[src]

The layout symbol for the Layout currently being used on the active workspace

pub fn set_root_window_name(&self, s: &str)[src]

Set the root X window name. Useful for exposing information to external programs

pub fn set_client_insert_point(&mut self, cip: InsertPoint)[src]

Set the insert point for new clients. Default is to insert at index 0.

pub fn focus_workspace(&mut self, selector: &Selector<'_, Workspace>)[src]

Set the displayed workspace for the focused screen to be index in the list of workspaces passed at init. This will panic if the index passed is out of bounds which is only possible if you manually bind an action to this with an invalid index. You should almost always be using the gen_keybindings! macro to set up your keybindings so this is not normally an issue.

pub fn toggle_workspace(&mut self)[src]

Switch focus back to the last workspace that had focus.

pub fn client_to_workspace(&mut self, selector: &Selector<'_, Workspace>)[src]

Move the focused client to the workspace matching 'selector'.

pub fn client_to_screen(&mut self, selector: &Selector<'_, Screen>)[src]

Move the focused client to the active workspace on the screen matching 'selector'.

pub fn toggle_client_fullscreen(&mut self, selector: &Selector<'_, Client>)[src]

Toggle the fullscreen state of the given client ID

pub fn kill_client(&mut self)[src]

Kill the focused client window.

pub fn screen(&self, selector: &Selector<'_, Screen>) -> Option<&Screen>[src]

Get a reference to the first Screen satisfying 'selector'. WinId selectors will return the screen containing that Client if the client is known. NOTE: It is not possible to get a mutable reference to a Screen.

pub fn focused_workspaces(&self) -> Vec<usize>[src]

The currently focused workspace indices being shown on each screen

pub fn add_workspace(&mut self, index: usize, ws: Workspace)[src]

Add a new workspace at index, shifting all workspaces with indices greater to the right.

pub fn push_workspace(&mut self, ws: Workspace)[src]

Add a new workspace at the end of the current workspace list

pub fn remove_workspace(
    &mut self,
    selector: &Selector<'_, Workspace>
) -> Option<Workspace>
[src]

Remove a Workspace from the WindowManager. All clients that were present on the removed workspace will be destroyed. WinId selectors will be ignored.

pub fn workspace(
    &self,
    selector: &Selector<'_, Workspace>
) -> Option<&Workspace>
[src]

Get a reference to the first Workspace satisfying 'selector'. WinId selectors will return the workspace containing that Client if the client is known.

pub fn workspace_mut(
    &mut self,
    selector: &Selector<'_, Workspace>
) -> Option<&mut Workspace>
[src]

Get a mutable reference to the first Workspace satisfying 'selector'. WinId selectors will return the workspace containing that Client if the client is known.

pub fn all_workspaces(
    &self,
    selector: &Selector<'_, Workspace>
) -> Vec<&Workspace>
[src]

Get a vector of references to Workspaces satisfying 'selector'. WinId selectors will return a vector with the workspace containing that Client if the client is known. Otherwise an empty vector will be returned.

pub fn all_workspaces_mut(
    &mut self,
    selector: &Selector<'_, Workspace>
) -> Vec<&mut Workspace>
[src]

Get a vector of mutable references to Workspaces satisfying 'selector'. WinId selectors will return a vector with the workspace containing that Client if the client is known. Otherwise an empty vector will be returned.

pub fn set_workspace_name(
    &mut self,
    name: impl Into<String>,
    selector: Selector<'_, Workspace>
)
[src]

Set the name of the selected Workspace

pub fn client(&self, selector: &Selector<'_, Client>) -> Option<&Client>[src]

Take a reference to the first Client found matching 'selector'

pub fn client_mut(
    &mut self,
    selector: &Selector<'_, Client>
) -> Option<&mut Client>
[src]

Take a mutable reference to the first Client found matching 'selector'

pub fn all_clients(&self, selector: &Selector<'_, Client>) -> Vec<&Client>[src]

Get a vector of references to the Clients found matching 'selector'. The resulting vector is sorted by Client id.

pub fn all_clients_mut(
    &mut self,
    selector: &Selector<'_, Client>
) -> Vec<&mut Client>
[src]

Get a vector of mutable references to the Clients found matching 'selector'. The resulting vector is sorted by Client id.

pub fn n_screens(&self) -> usize[src]

The number of detected screens currently being tracked by the WindowManager.

pub fn screen_size(&self, screen_index: usize) -> Option<Region>[src]

The current effective screen size of the target screen. Effective screen size is the physical screen size minus any space reserved for a status bar.

pub fn position_client(&self, id: WinId, region: Region, stack_above: bool)[src]

Position an individual client on the display. (x,y) coordinates are absolute (i.e. relative to the root window not any individual screen).

pub fn show_client(&mut self, id: WinId)[src]

Make the Client with ID 'id' visible at its last known position.

pub fn hide_client(&mut self, id: WinId)[src]

Hide the Client with ID 'id'.

pub fn layout_screen(&mut self, screen_index: usize)[src]

Layout the workspace currently shown on the given screen index.

pub fn active_screen_index(&self) -> usize[src]

An index into the WindowManager known screens for the screen that is currently focused

Auto Trait Implementations

impl<'a> !RefUnwindSafe for WindowManager<'a>

impl<'a> !Send for WindowManager<'a>

impl<'a> !Sync for WindowManager<'a>

impl<'a> Unpin for WindowManager<'a>

impl<'a> !UnwindSafe for WindowManager<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.