Skip to main content

WindowPolicy

Trait WindowPolicy 

Source
pub trait WindowPolicy: Send {
    // Required method
    fn handle(&mut self, event: Event, out: &mut Vec<Command>) -> Verdict;

    // Provided method
    fn view(&self) -> DesktopView { ... }
}
Expand description

A window manager’s decisions for the compositor; see the module documentation.

Required Methods§

Source

fn handle(&mut self, event: Event, out: &mut Vec<Command>) -> Verdict

Handle one event, pushing the commands it leads to onto out, and say whether an input event was taken. The verdict is read for Event::Pointer and Event::Key alone.

Provided Methods§

Source

fn view(&self) -> DesktopView

The desktop as the policy holds it now. Asked from the thread that calls WindowPolicy::handle, between events, so it must not block either.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§