Trait penrose::core::xconnection::XConn [−][src]
pub trait XConn: XState + XEventHandler + XClientHandler + XClientProperties + XClientConfig + Sized {
Show 13 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<()>;
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
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
fn check_window(&self) -> Xid
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
.
Perform any state cleanup required prior to shutting down the window manager
fn grab_keys(
&self,
key_bindings: &KeyBindings<Self>,
mouse_bindings: &MouseBindings<Self>
) -> Result<()>
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
fn mark_new_client(&self, id: Xid) -> Result<()>
fn mark_new_client(&self, id: Xid) -> Result<()>
Mark the given client as newly created
Set required EWMH properties to ensure compatability with external programs
Update the root window properties with the current desktop details
Update the root window properties with the current client details
fn set_current_workspace(&self, wix: usize) -> Result<()>
fn set_current_workspace(&self, wix: usize) -> Result<()>
Update which desktop is currently focused
fn set_root_window_name(&self, name: &str) -> Result<()>
fn set_root_window_name(&self, name: &str) -> Result<()>
Set the WM_NAME prop of the root window
Update which desktop a client is currently on
fn is_managed_client(&self, c: &Client) -> bool
fn is_managed_client(&self, c: &Client) -> bool
Check to see if this client is one that we should be handling or not