Trait XConn

Source
pub trait XConn:
    XState
    + XEventHandler
    + XClientHandler
    + XClientProperties
    + XClientConfig
    + Sized {
Show 13 methods // Required methods fn init(&self) -> Result<()>; fn check_window(&self) -> Xid; fn cleanup(&self) -> Result<()>; fn grab_keys( &self, key_bindings: &KeyBindings<Self>, mouse_bindings: &MouseBindings<Self>, ) -> Result<()>; // Provided methods fn mark_new_client(&self, id: Xid) -> Result<()> { ... } fn set_wm_properties(&self, workspaces: &[String]) -> Result<()> { ... } fn update_desktops(&self, workspaces: &[String]) -> Result<()> { ... } fn update_known_clients(&self, clients: &[Xid]) -> Result<()> { ... } fn set_current_workspace(&self, wix: usize) -> Result<()> { ... } fn set_root_window_name(&self, name: &str) -> Result<()> { ... } fn set_client_workspace(&self, id: Xid, wix: usize) -> Result<()> { ... } fn is_managed_client(&self, c: &Client) -> bool { ... } fn active_managed_clients( &self, floating_classes: &[&str], ) -> Result<Vec<Client>> { ... }
}
Expand description

A handle on a running X11 connection that we can use for issuing X requests.

XConn is intended as an abstraction layer to allow for communication with the underlying display system (assumed to be X) using whatever mechanism the implementer wishes. In theory, it should be possible to write an implementation that allows penrose to run on systems not using X as the windowing system but X idioms and high level event types / client interations are assumed.

Required Methods§

Source

fn init(&self) -> Result<()>

Initialise any state required before this connection can be used by the WindowManager.

This must include checking to see if another window manager is running and return an error if there is, but other than that there are no other requirements.

This method is called once during WindowManager::init

Source

fn check_window(&self) -> Xid

An X id for a check window that will be used for holding EWMH window manager properties

The creation of any resources required for this should be handled in init and the destruction of those resources should be handled in cleanup.

Source

fn cleanup(&self) -> Result<()>

Perform any state cleanup required prior to shutting down the window manager

Source

fn grab_keys( &self, key_bindings: &KeyBindings<Self>, mouse_bindings: &MouseBindings<Self>, ) -> Result<()>

Notify the X server that we are intercepting the user specified key bindings and prevent them being passed through to the underlying applications.

This is what determines which key press events end up being sent through in the main event loop for the WindowManager.

Provided Methods§

Source

fn mark_new_client(&self, id: Xid) -> Result<()>

Mark the given client as newly created

Source

fn set_wm_properties(&self, workspaces: &[String]) -> Result<()>

Set required EWMH properties to ensure compatability with external programs

Source

fn update_desktops(&self, workspaces: &[String]) -> Result<()>

Update the root window properties with the current desktop details

Source

fn update_known_clients(&self, clients: &[Xid]) -> Result<()>

Update the root window properties with the current client details

Source

fn set_current_workspace(&self, wix: usize) -> Result<()>

Update which desktop is currently focused

Source

fn set_root_window_name(&self, name: &str) -> Result<()>

Set the WM_NAME prop of the root window

Source

fn set_client_workspace(&self, id: Xid, wix: usize) -> Result<()>

Update which desktop a client is currently on

Source

fn is_managed_client(&self, c: &Client) -> bool

Check to see if this client is one that we should be handling or not

Source

fn active_managed_clients( &self, floating_classes: &[&str], ) -> Result<Vec<Client>>

The subset of active clients that are considered managed by penrose

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl XConn for XcbConnection

Source§

impl<T> XConn for T
where T: StubXConn,