pub struct Window {
    pub has_frame: Arc<AtomicBool>,
    pub wayland_surface: Option<Attached<WlSurface>>,
    pub scale_factor: f64,
    window: WinitWindow,
    title: String,
    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: Arc<AtomicBool>

Flag tracking that we have a frame we can draw.

§wayland_surface: Option<Attached<WlSurface>>

Attached Wayland surface to request new frame events.

§scale_factor: f64

Cached scale factor for quickly scaling pixel sizes.

§window: WinitWindow§title: String

Current window title.

§current_mouse_cursor: CursorIcon§mouse_visible: bool

Implementations§

source§

impl Window

source

pub fn new<E>( event_loop: &EventLoopWindowTarget<E>, config: &UiConfig, identity: &Identity, wayland_event_queue: Option<&EventQueue>, 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 set_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(&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> ) -> WindowBuilder

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_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 set_fullscreen(&self, fullscreen: bool)

source

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

source

pub fn wayland_surface(&self) -> Option<&Attached<WlSurface>>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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.