pub struct XcbConnection { /* private fields */ }
Expand description
Handles communication with an X server via the XCB library.
XcbConnection is a minimal implementation that does not make use of the full asyc capabilities of the underlying C XCB library.
Implementations§
Source§impl XcbConnection
impl XcbConnection
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Establish a new connection to the running X server. Fails if unable to connect
Sourcepub fn xcb_connection(&self) -> &Connection
pub fn xcb_connection(&self) -> &Connection
Get a handle on the underlying XCB Connection used by Api to communicate with the X server.
Trait Implementations§
Source§impl Debug for XcbConnection
impl Debug for XcbConnection
Source§impl XAtomQuerier for XcbConnection
impl XAtomQuerier for XcbConnection
Source§impl XClientConfig for XcbConnection
impl XClientConfig for XcbConnection
Source§fn configure_client(&self, id: Xid, data: &[ClientConfig]) -> Result<()>
fn configure_client(&self, id: Xid, data: &[ClientConfig]) -> Result<()>
Configure the on screen appearance of a client window
Source§fn set_client_attributes(&self, id: Xid, data: &[ClientAttr]) -> Result<()>
fn set_client_attributes(&self, id: Xid, data: &[ClientAttr]) -> Result<()>
Set client attributes such as event masks, border color etc
Source§fn get_window_attributes(&self, id: Xid) -> Result<WindowAttributes>
fn get_window_attributes(&self, id: Xid) -> Result<WindowAttributes>
Get the WindowAttributes for this client
Source§fn position_client(
&self,
id: Xid,
r: Region,
border: u32,
stack_above: bool,
) -> Result<()>
fn position_client( &self, id: Xid, r: Region, border: u32, stack_above: bool, ) -> Result<()>
Reposition the window identified by ‘id’ to the specifed region
Source§impl XClientHandler for XcbConnection
impl XClientHandler for XcbConnection
Source§impl XClientProperties for XcbConnection
impl XClientProperties for XcbConnection
Source§fn get_prop(&self, id: Xid, name: &str) -> Result<Prop>
fn get_prop(&self, id: Xid, name: &str) -> Result<Prop>
Query a property for a client by ID and name. Read more
Source§fn list_props(&self, id: Xid) -> Result<Vec<String>>
fn list_props(&self, id: Xid) -> Result<Vec<String>>
Return the list of all properties set on the given client window Read more
Source§fn delete_prop(&self, id: Xid, name: &str) -> Result<()>
fn delete_prop(&self, id: Xid, name: &str) -> Result<()>
Delete an existing property from a client
Source§fn change_prop(&self, id: Xid, prop: &str, val: Prop) -> Result<()>
fn change_prop(&self, id: Xid, prop: &str, val: Prop) -> Result<()>
Change an existing property for a client
Source§fn set_client_state(&self, id: Xid, state: WindowState) -> Result<()>
fn set_client_state(&self, id: Xid, state: WindowState) -> Result<()>
Update a client’s
WM_STATE
property to the given value. Read moreSource§fn client_supports_protocol(&self, id: Xid, proto: &str) -> Result<bool>
fn client_supports_protocol(&self, id: Xid, proto: &str) -> Result<bool>
Check to see if a given client window supports a particular protocol or not
Source§fn client_accepts_focus(&self, id: Xid) -> bool
fn client_accepts_focus(&self, id: Xid) -> bool
Check to see if a given client accepts input focus
Source§fn toggle_client_fullscreen(
&self,
id: Xid,
client_is_fullscreen: bool,
) -> Result<()>
fn toggle_client_fullscreen( &self, id: Xid, client_is_fullscreen: bool, ) -> Result<()>
Toggle the fullscreen state of the given client ID with the X server
Source§impl XConn for XcbConnection
impl XConn for XcbConnection
Source§fn init(&self) -> Result<()>
fn init(&self) -> Result<()>
Initialise any state required before this connection can be used by the WindowManager. Read more
Source§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 Read more
Source§fn cleanup(&self) -> Result<()>
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<()>
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. Read more
Source§fn set_wm_properties(&self, workspaces: &[String]) -> Result<()>
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<()>
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<()>
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<()>
fn set_current_workspace(&self, wix: usize) -> Result<()>
Update which desktop is currently focused
Source§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
Source§fn set_client_workspace(&self, id: Xid, wix: usize) -> Result<()>
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
fn is_managed_client(&self, c: &Client) -> bool
Check to see if this client is one that we should be handling or not
Source§impl XEventHandler for XcbConnection
impl XEventHandler for XcbConnection
Source§fn wait_for_event(&self) -> Result<XEvent>
fn wait_for_event(&self) -> Result<XEvent>
Wait for the next event from the X server and return it as an XEvent
Source§fn send_client_event(&self, msg: ClientMessage) -> Result<()>
fn send_client_event(&self, msg: ClientMessage) -> Result<()>
Send an X event to the target client Read more
Source§fn build_client_event(&self, kind: ClientMessageKind) -> Result<ClientMessage>
fn build_client_event(&self, kind: ClientMessageKind) -> Result<ClientMessage>
Build the required event data for sending a known client event.
Source§impl XState for XcbConnection
impl XState for XcbConnection
Source§fn current_screens(&self) -> Result<Vec<Screen>>
fn current_screens(&self) -> Result<Vec<Screen>>
Determine the currently connected screens and return their details
Source§fn cursor_position(&self) -> Result<Point>
fn cursor_position(&self) -> Result<Point>
Determine the current (x,y) position of the cursor relative to the root window.
Source§fn warp_cursor(&self, win_id: Option<Xid>, screen: &Screen) -> Result<()>
fn warp_cursor(&self, win_id: Option<Xid>, screen: &Screen) -> Result<()>
Warp the cursor to be within the specified window. If id == None then behaviour is
definined by the implementor (e.g. warp cursor to active window, warp to center of screen)
Source§fn client_geometry(&self, id: Xid) -> Result<Region>
fn client_geometry(&self, id: Xid) -> Result<Region>
Return the current (x, y, w, h) dimensions of the requested window
Source§fn active_clients(&self) -> Result<Vec<Xid>>
fn active_clients(&self) -> Result<Vec<Xid>>
Run on startup/restart to determine already running windows that we need to track
Source§fn focused_client(&self) -> Result<Xid>
fn focused_client(&self) -> Result<Xid>
Return the client ID of the crate::core::client::Client that currently holds X focus
Auto Trait Implementations§
impl Freeze for XcbConnection
impl RefUnwindSafe for XcbConnection
impl !Send for XcbConnection
impl !Sync for XcbConnection
impl Unpin for XcbConnection
impl UnwindSafe for XcbConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more