Skip to main content

AppSurface

Trait AppSurface 

pub trait AppSurface {
    // Required methods
    fn scale_factor(&self) -> f64;
    fn inner_size(&self) -> PhysicalSize<u32>;
    fn request_redraw(&self);
    fn set_cursor(&self, cursor: CursorIcon);

    // Provided method
    fn hosts_tab_chords(&self) -> bool { ... }
}
Expand description

What an App needs from the surface it is shown on.

Required Methods§

fn scale_factor(&self) -> f64

Physical pixels per logical pixel.

fn inner_size(&self) -> PhysicalSize<u32>

The surface’s size in physical pixels.

fn request_redraw(&self)

Ask for another frame.

fn set_cursor(&self, cursor: CursorIcon)

Show cursor while the pointer is over the app.

Provided Methods§

fn hosts_tab_chords(&self) -> bool

Whether the surface’s host answers the desktop’s tab chords (Ctrl+T, Ctrl+W, Ctrl+Shift+T) itself, so the app leaves them unhandled for it rather than asking the session’s tab service.

Implementors§