Struct xlib_display_server::XWrap
source · pub struct XWrap {
pub atoms: XAtom,
pub managed_windows: Vec<Window>,
pub focused_window: Window,
pub tag_labels: Vec<String>,
pub mode: Mode,
pub focus_behaviour: FocusBehaviour,
pub mouse_key_mask: ModMask,
pub mode_origin: (i32, i32),
pub task_notify: Arc<Notify>,
pub motion_event_limiter: c_ulong,
pub refresh_rate: c_short,
/* private fields */
}Expand description
Contains Xserver information and origins.
Fields§
§atoms: XAtom§managed_windows: Vec<Window>§focused_window: Window§tag_labels: Vec<String>§mode: Mode§focus_behaviour: FocusBehaviour§mouse_key_mask: ModMask§mode_origin: (i32, i32)§task_notify: Arc<Notify>§motion_event_limiter: c_ulong§refresh_rate: c_shortImplementations§
source§impl XWrap
impl XWrap
sourcepub fn get_all_windows(&self) -> Result<Vec<Window>, String>
pub fn get_all_windows(&self) -> Result<Vec<Window>, String>
Returns the child windows of all roots.
Errors
Will error if root has no windows or there is an error
obtaining the root windows. See get_windows_for_root.
sourcepub fn get_cursor_point(&self) -> Result<(i32, i32), XlibError>
pub fn get_cursor_point(&self) -> Result<(i32, i32), XlibError>
sourcepub fn get_cursor_window(&self) -> Result<WindowHandle, XlibError>
pub fn get_cursor_window(&self) -> Result<WindowHandle, XlibError>
sourcepub const fn get_default_root_handle(&self) -> WindowHandle
pub const fn get_default_root_handle(&self) -> WindowHandle
Returns the handle of the default root.
sourcepub const fn get_default_root(&self) -> Window
pub const fn get_default_root(&self) -> Window
Returns the default root.
sourcepub fn get_hint_sizing_as_xyhw(&self, window: Window) -> Option<XyhwChange>
pub fn get_hint_sizing_as_xyhw(&self, window: Window) -> Option<XyhwChange>
Returns the WM_SIZE_HINTS/WM_NORMAL_HINTS of a window as a XyhwChange.
sourcepub fn get_mask_event(&self) -> XEvent
pub fn get_mask_event(&self) -> XEvent
Returns the next Xevent that matches the mask of the xserver.
sourcepub fn get_next_event(&self) -> XEvent
pub fn get_next_event(&self) -> XEvent
Returns the next Xevent of the xserver.
sourcepub fn get_screens(&self) -> Vec<Screen>
pub fn get_screens(&self) -> Vec<Screen>
Returns all the screens of the display.
Panics
Panics if xorg cannot be contacted (xlib missing, not started, etc.) Also panics if window attrs cannot be obtained.
sourcepub fn get_screens_area_dimensions(&self) -> (i32, i32)
pub fn get_screens_area_dimensions(&self) -> (i32, i32)
Returns the dimensions of the screens.
sourcepub fn get_transient_for(&self, window: Window) -> Option<Window>
pub fn get_transient_for(&self, window: Window) -> Option<Window>
Returns the transient parent of a window.
sourcepub fn get_window_actions_atoms(&self, window: Window) -> Vec<Atom>
pub fn get_window_actions_atoms(&self, window: Window) -> Vec<Atom>
Returns the atom actions of a window.
sourcepub fn get_window_attrs(
&self,
window: Window
) -> Result<XWindowAttributes, XlibError>
pub fn get_window_attrs( &self, window: Window ) -> Result<XWindowAttributes, XlibError>
sourcepub fn get_window_class(&self, window: Window) -> Option<(String, String)>
pub fn get_window_class(&self, window: Window) -> Option<(String, String)>
Returns a windows class WM_CLASS
sourcepub fn get_window_geometry(
&self,
window: Window
) -> Result<XyhwChange, XlibError>
pub fn get_window_geometry( &self, window: Window ) -> Result<XyhwChange, XlibError>
Returns the geometry of a window as a XyhwChange struct.
Errors
Errors if Xlib returns a status of 0.
sourcepub fn get_window_name(&self, window: Window) -> Option<String>
pub fn get_window_name(&self, window: Window) -> Option<String>
Returns a windows name.
sourcepub fn get_window_legacy_name(&self, window: Window) -> Option<String>
pub fn get_window_legacy_name(&self, window: Window) -> Option<String>
Returns a WM_NAME (not _NETwindows name).
sourcepub fn get_window_pid(&self, window: Window) -> Option<u32>
pub fn get_window_pid(&self, window: Window) -> Option<u32>
Returns a windows _NET_WM_PID.
sourcepub fn get_window_states(&self, window: Window) -> Vec<WindowState>
pub fn get_window_states(&self, window: Window) -> Vec<WindowState>
Returns the states of a window.
sourcepub fn get_window_states_atoms(&self, window: Window) -> Vec<Atom>
pub fn get_window_states_atoms(&self, window: Window) -> Vec<Atom>
Returns the atom states of a window.
sourcepub fn get_window_strut_array(&self, window: Window) -> Option<DockArea>
pub fn get_window_strut_array(&self, window: Window) -> Option<DockArea>
Returns structure of a window as a DockArea.
sourcepub fn get_window_type(&self, window: Window) -> WindowType
pub fn get_window_type(&self, window: Window) -> WindowType
Returns the type of a window.
sourcepub fn get_wmhints(&self, window: Window) -> Option<XWMHints>
pub fn get_wmhints(&self, window: Window) -> Option<XWMHints>
Returns the WM_HINTS of a window.
sourcepub fn get_wm_state(&self, window: Window) -> Option<c_long>
pub fn get_wm_state(&self, window: Window) -> Option<c_long>
Returns the WM_STATE of a window.
source§impl XWrap
impl XWrap
sourcepub fn grab_mouse_clicks(&self, handle: Window, is_focused: bool)
pub fn grab_mouse_clicks(&self, handle: Window, is_focused: bool)
Grabs the mouse clicks of a window.
Grabs the button with the modifier for a window.
Cleans all currently grabbed buttons of a window.
sourcepub fn grab_pointer(&self, cursor: c_ulong)
pub fn grab_pointer(&self, cursor: c_ulong)
Grabs the cursor and sets its visual.
sourcepub fn ungrab_pointer(&self)
pub fn ungrab_pointer(&self)
Ungrab the cursor.
sourcepub fn move_cursor_to_window(&self, window: Window) -> Result<(), XlibError>
pub fn move_cursor_to_window(&self, window: Window) -> Result<(), XlibError>
Move the cursor to a window.
Errors
Will error if unable to obtain window attributes. See get_window_attrs.
sourcepub fn replay_click(&self, focused_window: Window, button: c_uint)
pub fn replay_click(&self, focused_window: Window, button: c_uint)
Replay a click on a window.
sourcepub fn allow_pointer_events(&self)
pub fn allow_pointer_events(&self)
Release the pointer if it is frozen.
source§impl XWrap
impl XWrap
sourcepub fn append_property_long(
&self,
window: Window,
property: Atom,
type: Atom,
data: &[c_long]
)
pub fn append_property_long( &self, window: Window, property: Atom, type: Atom, data: &[c_long] )
Appends a window property.
sourcepub fn replace_property_long(
&self,
window: Window,
property: Atom,
type: Atom,
data: &[c_long]
)
pub fn replace_property_long( &self, window: Window, property: Atom, type: Atom, data: &[c_long] )
Replaces a window property.
sourcepub fn set_client_list(&self)
pub fn set_client_list(&self)
Sets the client list to the currently managed windows.
sourcepub fn set_current_desktop(&self, current_tag: Option<TagId>)
pub fn set_current_desktop(&self, current_tag: Option<TagId>)
Sets the current desktop.
sourcepub fn set_desktop_prop(&self, data: &[u32], atom: c_ulong)
pub fn set_desktop_prop(&self, data: &[u32], atom: c_ulong)
Sets a desktop property.
sourcepub fn set_desktop_prop_c_ulong(
&self,
value: c_ulong,
atom: c_ulong,
type: c_ulong
)
pub fn set_desktop_prop_c_ulong( &self, value: c_ulong, atom: c_ulong, type: c_ulong )
Sets a desktop property with type c_ulong.
sourcepub fn set_desktop_prop_string(
&self,
value: &str,
atom: c_ulong,
encoding: Atom
)
pub fn set_desktop_prop_string( &self, value: &str, atom: c_ulong, encoding: Atom )
Sets a desktop property with type string.
sourcepub fn set_state(&self, handle: WindowHandle, toggle_to: bool, atom: Atom)
pub fn set_state(&self, handle: WindowHandle, toggle_to: bool, atom: Atom)
Sets a windows state.
sourcepub fn set_window_border_color(&self, window: Window, color: c_ulong)
pub fn set_window_border_color(&self, window: Window, color: c_ulong)
Sets a windows border color.
pub fn set_background_color(&self, color: c_ulong)
sourcepub fn set_window_config(
&self,
window: Window,
window_changes: XWindowChanges,
unlock: u32
)
pub fn set_window_config( &self, window: Window, window_changes: XWindowChanges, unlock: u32 )
Sets a windows configuration.
sourcepub fn set_window_desktop(&self, window: Window, current_tag: &TagId)
pub fn set_window_desktop(&self, window: Window, current_tag: &TagId)
Sets what desktop a window is on.
sourcepub fn set_window_states_atoms(&self, window: Window, states: &[Atom])
pub fn set_window_states_atoms(&self, window: Window, states: &[Atom])
Sets the atom states of a window.
pub fn set_window_urgency(&self, window: Window, is_urgent: bool)
sourcepub fn set_wmhints(&self, window: Window, wmh: &mut XWMHints)
pub fn set_wmhints(&self, window: Window, wmh: &mut XWMHints)
Sets the XWMHints of a window.
sourcepub fn set_wm_states(&self, window: Window, states: &[c_long])
pub fn set_wm_states(&self, window: Window, states: &[c_long])
Sets the WM_STATE of a window.
source§impl XWrap
impl XWrap
sourcepub fn setup_window(&self, window: Window) -> Option<DisplayEvent>
pub fn setup_window(&self, window: Window) -> Option<DisplayEvent>
Sets up a window before we manage it.
sourcepub fn setup_managed_window(
&mut self,
h: WindowHandle,
floating: bool,
follow_mouse: bool
) -> Option<DisplayEvent>
pub fn setup_managed_window( &mut self, h: WindowHandle, floating: bool, follow_mouse: bool ) -> Option<DisplayEvent>
Sets up a window that we want to manage.
sourcepub fn teardown_managed_window(&mut self, h: &WindowHandle, destroyed: bool)
pub fn teardown_managed_window(&mut self, h: &WindowHandle, destroyed: bool)
Teardown a managed window when it is destroyed.
sourcepub fn update_window(&self, window: &Window)
pub fn update_window(&self, window: &Window)
Updates a window.
sourcepub fn toggle_window_visibility(&self, window: Window, visible: bool)
pub fn toggle_window_visibility(&self, window: Window, visible: bool)
Maps and unmaps a window depending on it is visible.
sourcepub fn window_take_focus(&mut self, window: &Window, previous: Option<&Window>)
pub fn window_take_focus(&mut self, window: &Window, previous: Option<&Window>)
Makes a window take focus.
sourcepub fn unfocus(&self, handle: Option<WindowHandle>, floating: bool)
pub fn unfocus(&self, handle: Option<WindowHandle>, floating: bool)
Unfocuses all windows.
sourcepub fn configure_window(&self, window: &Window)
pub fn configure_window(&self, window: &Window)
Send a XConfigureEvent for a window to X.
sourcepub fn change_window_attributes(
&self,
window: Window,
mask: c_ulong,
attrs: XSetWindowAttributes
)
pub fn change_window_attributes( &self, window: Window, mask: c_ulong, attrs: XSetWindowAttributes )
Change a windows attributes.
sourcepub fn restack(&self, handles: Vec<WindowHandle>)
pub fn restack(&self, handles: Vec<WindowHandle>)
Restacks the windows to the order of the vec.
pub fn move_resize_window(&self, window: Window, x: i32, y: i32, w: u32, h: u32)
sourcepub fn move_to_top(&self, handle: &WindowHandle)
pub fn move_to_top(&self, handle: &WindowHandle)
Raise a window.
sourcepub fn kill_window(&self, h: &WindowHandle)
pub fn kill_window(&self, h: &WindowHandle)
Kills a window.
sourcepub fn force_unmapped(&mut self, window: Window)
pub fn force_unmapped(&mut self, window: Window)
Forcibly unmap a window.
sourcepub fn subscribe_to_event(&self, window: Window, mask: c_long)
pub fn subscribe_to_event(&self, window: Window, mask: c_long)
Subscribe to an event of a window.
sourcepub fn subscribe_to_window_events(&self, window: Window)
pub fn subscribe_to_window_events(&self, window: Window)
Subscribe to the wanted events of a window.
source§impl XWrap
impl XWrap
pub fn load_config( &mut self, config: &impl Config, focused: Option<&Option<WindowHandle>>, windows: &[Window] )
sourcepub fn init_desktops_hints(&self)
pub fn init_desktops_hints(&self)
sourcepub fn send_xevent(
&self,
window: Window,
propogate: i32,
mask: c_long,
event: &mut XEvent
)
pub fn send_xevent( &self, window: Window, propogate: i32, mask: c_long, event: &mut XEvent )
Send a xevent for a window to X.
sourcepub fn load_colors(
&mut self,
config: &impl Config,
focused: Option<&Option<WindowHandle>>,
windows: Option<&[Window]>
)
pub fn load_colors( &mut self, config: &impl Config, focused: Option<&Option<WindowHandle>>, windows: Option<&[Window]> )
Load the colors of our theme.
sourcepub async fn wait_readable(&mut self)
pub async fn wait_readable(&mut self)
Wait until readable.