pub struct X11Wm { /* private fields */ }xwayland only.Expand description
The runtime state of an reparenting XWayland window manager.
Implementations§
Source§impl X11Wm
impl X11Wm
Sourcepub fn start_wm<D>(
handle: LoopHandle<'static, D>,
dh: &DisplayHandle,
connection: UnixStream,
client: Client,
) -> Result<Self, Box<dyn Error>>where
D: XwmHandler + XWaylandShellHandler + SeatHandler + DndGrabHandler + 'static,
<D as SeatHandler>::PointerFocus: DndFocus<D>,
<D as SeatHandler>::TouchFocus: DndFocus<D>,
pub fn start_wm<D>(
handle: LoopHandle<'static, D>,
dh: &DisplayHandle,
connection: UnixStream,
client: Client,
) -> Result<Self, Box<dyn Error>>where
D: XwmHandler + XWaylandShellHandler + SeatHandler + DndGrabHandler + 'static,
<D as SeatHandler>::PointerFocus: DndFocus<D>,
<D as SeatHandler>::TouchFocus: DndFocus<D>,
Start a new window manager for a given Xwayland connection
§Arguments
handleis an eventloop handle used to queue up and handle incoming X11 eventsdhis the corresponding display handle to the wayland connection of the Xwayland instanceconnectionis the corresponding x11 client connection of the Xwayland instanceclientis the wayland client instance of the Xwayland instance
Sourcepub fn raise_window<'a, W: X11Relatable + 'a>(
&mut self,
window: &'a W,
) -> Result<(), ConnectionError>
pub fn raise_window<'a, W: X11Relatable + 'a>( &mut self, window: &'a W, ) -> Result<(), ConnectionError>
Raises a window in the internal X11 state
Needs to be called to match raising of windows inside the compositor to keep the stacking order in sync with the compositor to avoid erroneous behavior.
Sourcepub fn update_stacking_order_downwards<'a, W: X11Relatable + 'a>(
&mut self,
order: impl Iterator<Item = &'a W>,
) -> Result<(), ConnectionError>
pub fn update_stacking_order_downwards<'a, W: X11Relatable + 'a>( &mut self, order: impl Iterator<Item = &'a W>, ) -> Result<(), ConnectionError>
Updates the stacking order by matching provided windows downwards.
This function reorders provided x11 windows in such a way,
that windows inside the internal X11 stack follow the provided order
without moving other windows around as much as possible. The internal stack
stores windows bottom -> top, so order here is also bottom -> top.
Window IDs unknown to this XWM will be ignored.
The first window in order found will not be moved.
If a window is encountered in order that is stacked below the first window,
it will be moved to be directly above the previous window in order.
E.g. Windows C -> A -> B -> E given in order with an internal stack of D -> A -> B -> C,
will be reordered as D -> C -> A -> B. First A is moved to be directly
above C, then Bis moved to be directly above A.
Windows in the internal stack, that are not present in order
will be skipped over in the process.
So if windows A -> C are given in order and the internal stack is A -> B -> C,
no reordering will occur.
See X11Wm::update_stacking_order_upwards for a variant of this algorithm,
which works from the bottom up or X11Wm::raise_window for an easier but
much more limited way to reorder.
Sourcepub fn update_stacking_order_upwards<'a, W: X11Relatable + 'a>(
&mut self,
order: impl Iterator<Item = &'a W>,
) -> Result<(), ConnectionError>
pub fn update_stacking_order_upwards<'a, W: X11Relatable + 'a>( &mut self, order: impl Iterator<Item = &'a W>, ) -> Result<(), ConnectionError>
Updates the stacking order by moving provided windows upwards.
This function reorders provided x11 windows in such a way,
that windows inside the internal X11 stack follow the provided order
in reverse without moving other windows around as much as possible. The
internal stack stores windows bottom -> top, so due to the reversal, order
here is top -> bottom.
Window IDs unknown to this XWM will be ignored.
The first window in order found will not be moved.
If a window is encountered in order that is stacked above the first window,
it will be moved to be directly below the previous window in order.
E.g. Windows C -> A -> B given in order with an internal stack of D -> A -> B -> C,
will be reordered as D -> B -> A -> C. A is below C, so it isn’t moved,
then B is moved to be directly below A.
Windows in the internal stack, that are not present in order
will be skipped over in the process.
So if windows A -> C are given in order and the internal stack is C -> B -> A,
no reordering will occur.
See X11Wm::update_stacking_order_downwards for a variant of this algorithm,
which works from the top down or X11Wm::raise_window for an easier but
much more limited way to reorder.
Sourcepub fn set_cursor(
&mut self,
pixels: &[u8],
size: Size<u16, Logical>,
hotspot: Point<u16, Logical>,
) -> Result<(), ReplyOrIdError>
pub fn set_cursor( &mut self, pixels: &[u8], size: Size<u16, Logical>, hotspot: Point<u16, Logical>, ) -> Result<(), ReplyOrIdError>
Set the default cursor used by X clients.
pixels is expected to be in rgba-format with each channel encoded as an u8.
This function will panic, if pixels is not at least size.w * size.h * 4 long.
Sourcepub fn new_selection(
&mut self,
selection: SelectionTarget,
mime_types: Option<Vec<String>>,
) -> Result<(), ReplyOrIdError>
pub fn new_selection( &mut self, selection: SelectionTarget, mime_types: Option<Vec<String>>, ) -> Result<(), ReplyOrIdError>
Notify Xwayland of a new selection.
mime_types being None indicate there is no active selection anymore.
Sourcepub fn send_selection(
&mut self,
selection_type: SelectionTarget,
mime_type: String,
fd: OwnedFd,
) -> Result<(), SelectionError>
pub fn send_selection( &mut self, selection_type: SelectionTarget, mime_type: String, fd: OwnedFd, ) -> Result<(), SelectionError>
Request to transfer the active selection for the provided mime_type to the provided file descriptor.
Sourcepub fn set_xsettings(
&mut self,
settings: impl Iterator<Item = (String, Value)>,
) -> Result<(), SettingsError>
pub fn set_xsettings( &mut self, settings: impl Iterator<Item = (String, Value)>, ) -> Result<(), SettingsError>
Updates XSETTINGS with the newly provided name/value-pairs.
Sourcepub fn get_randr_primary_output(&self) -> Result<Option<String>, ReplyError>
pub fn get_randr_primary_output(&self) -> Result<Option<String>, ReplyError>
Gets the current primary output as advertised by xrandr
Sourcepub fn set_randr_primary_output(
&mut self,
output: Option<&Output>,
) -> Result<(), PrimaryOutputError>
pub fn set_randr_primary_output( &mut self, output: Option<&Output>, ) -> Result<(), PrimaryOutputError>
Updates the primary output as advertised by xrandr
Trait Implementations§
Auto Trait Implementations§
impl Freeze for X11Wm
impl !RefUnwindSafe for X11Wm
impl Send for X11Wm
impl Sync for X11Wm
impl Unpin for X11Wm
impl !UnwindSafe for X11Wm
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.