pub struct Window {
    pub has_frame: bool,
    pub scale_factor: f64,
    pub requested_redraw: bool,
    window: Window,
    title: String,
    is_x11: bool,
    current_mouse_cursor: CursorIcon,
    mouse_visible: bool,
}
Expand description

A window which can be used for displaying the terminal.

Wraps the underlying windowing library to provide a stable API in Alacritty.

Fields§

§has_frame: bool

Flag tracking that we have a frame we can draw.

§scale_factor: f64

Cached scale factor for quickly scaling pixel sizes.

§requested_redraw: bool

Flag indicating whether redraw was requested.

§window: Window§title: String

Current window title.

§is_x11: bool§current_mouse_cursor: CursorIcon§mouse_visible: bool

Implementations§

source§

impl Window

source

pub fn new( event_loop: &ActiveEventLoop, config: &UiConfig, identity: &Identity, x11_visual: Option<X11VisualInfo> ) -> Result<Window, Error>

Create a new window.

This creates a window and fully initializes a window.

source

pub fn raw_window_handle(&self) -> RawWindowHandle

source

pub fn request_inner_size(&self, size: PhysicalSize<u32>)

source

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

source

pub fn set_visible(&self, visibility: bool)

source

pub fn set_title(&mut self, title: String)

Set the window title.

source

pub fn title(&self) -> &str

Get the window title.

source

pub fn request_redraw(&mut self)

source

pub fn set_mouse_cursor(&mut self, cursor: CursorIcon)

source

pub fn set_mouse_visible(&mut self, visible: bool)

Set mouse cursor visible.

source

pub fn get_platform_window( identity: &Identity, window_config: &WindowConfig, x11_visual: Option<X11VisualInfo> ) -> WindowAttributes

source

pub fn set_urgent(&self, is_urgent: bool)

source

pub fn id(&self) -> WindowId

source

pub fn set_transparent(&self, transparent: bool)

source

pub fn set_blur(&self, blur: bool)

source

pub fn set_maximized(&self, maximized: bool)

source

pub fn set_minimized(&self, minimized: bool)

source

pub fn set_resize_increments(&self, increments: PhysicalSize<f32>)

source

pub fn toggle_fullscreen(&self)

Toggle the window’s fullscreen state.

source

pub fn toggle_maximized(&self)

Toggle the window’s maximized state.

source

pub fn pre_present_notify(&self)

Inform windowing system about presenting to the window.

Should be called right before presenting to the window with e.g. eglSwapBuffers.

source

pub fn set_theme(&self, theme: Option<Theme>)

source

pub fn set_fullscreen(&self, fullscreen: bool)

source

pub fn current_monitor(&self) -> Option<MonitorHandle>

source

pub fn set_ime_allowed(&self, allowed: bool)

source

pub fn update_ime_position(&self, point: Point<usize>, size: &SizeInfo)

Adjust the IME editor position according to the new location of the cursor.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Window

§

impl Send for Window

§

impl Sync for Window

§

impl Unpin for Window

§

impl !UnwindSafe for Window

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for Twhere T: Any,

source§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert 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.
source§

fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more