[][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)[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 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 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 at index in the workspaces list. This will panic if you pass an index that is out of bounds.

pub fn kill_client(&mut self)[src]

Kill the focused client window.

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 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 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)[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(&self, id: WinId)[src]

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

pub fn hide_client(&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.