[][src]Trait penrose::xconnection::XConn

pub trait XConn {
    fn flush(&self) -> bool;
fn wait_for_event(&self) -> Option<XEvent>;
fn current_outputs(&self) -> Vec<Screen>;
fn cursor_position(&self) -> Point;
fn position_window(&self, id: WinId, r: Region, border: u32);
fn mark_new_window(&self, id: WinId);
fn map_window(&self, id: WinId);
fn unmap_window(&self, id: WinId);
fn send_client_event(&self, id: WinId, atom_name: &str);
fn focus_client(&self, id: WinId);
fn set_client_border_color(&self, id: WinId, color: u32);
fn grab_keys(&self, key_bindings: &KeyBindings);
fn set_wm_properties(&self, workspaces: &[&'static str]);
fn set_current_workspace(&self, wix: usize);
fn set_root_window_name(&self, name: &str);
fn set_client_workspace(&self, id: WinId, wix: usize);
fn window_should_float(&self, id: WinId, floating_classes: &[&str]) -> bool;
fn warp_cursor(&self, win_id: Option<WinId>, screen: &Screen);
fn query_for_active_windows(&self) -> Vec<WinId>;
fn str_prop(&self, id: u32, name: &str) -> Result<String, String>;
fn atom_prop(&self, id: u32, name: &str) -> Result<u32, String>;
fn cleanup(&self); }

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

Required methods

fn flush(&self) -> bool

Flush pending actions to the X event loop

fn wait_for_event(&self) -> Option<XEvent>

Wait for the next event from the X server and return it as an XEvent

fn current_outputs(&self) -> Vec<Screen>

Determine the currently connected CRTCs and return their details

fn cursor_position(&self) -> Point

Determine the current (x,y) position of the cursor relative to the root window.

fn position_window(&self, id: WinId, r: Region, border: u32)

Reposition the window identified by 'id' to the specifed region

fn mark_new_window(&self, id: WinId)

Mark the given window as newly created

fn map_window(&self, id: WinId)

Map a window to the display. Called each time a map_notify event is received

fn unmap_window(&self, id: WinId)

Unmap a window from the display. Called each time an unmap_notify event is received

fn send_client_event(&self, id: WinId, atom_name: &str)

Send an X event to the target window

fn focus_client(&self, id: WinId)

Mark the given client as having focus

fn set_client_border_color(&self, id: WinId, color: u32)

Change the border color for the given client

fn grab_keys(&self, key_bindings: &KeyBindings)

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.

fn set_wm_properties(&self, workspaces: &[&'static str])

Set required EWMH properties to ensure compatability with external programs

fn set_current_workspace(&self, wix: usize)

Update which desktop is currently focused

fn set_root_window_name(&self, name: &str)

Set the WM_NAME prop of the root window

fn set_client_workspace(&self, id: WinId, wix: usize)

Update which desktop a client is currently on

fn window_should_float(&self, id: WinId, floating_classes: &[&str]) -> bool

Determine whether the target window should be tiled or allowed to float

fn warp_cursor(&self, win_id: Option<WinId>, screen: &Screen)

Warp the cursor to be within the specified window. If win_id == None then behaviour is definined by the implementor (e.g. warp cursor to active window, warp to center of screen)

fn query_for_active_windows(&self) -> Vec<WinId>

Run on startup/restart to determine already running windows that we need to track

fn str_prop(&self, id: u32, name: &str) -> Result<String, String>

Use the xcb api to query a string property for a window by window ID and poperty name. Can fail if the property name is invalid or we get a malformed response from xcb.

fn atom_prop(&self, id: u32, name: &str) -> Result<u32, String>

Fetch an atom prop by name for a particular window ID

fn cleanup(&self)

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

Loading content...

Implementors

impl XConn for MockXConn[src]

impl XConn for XcbConnection[src]

Loading content...