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
impl Window
sourcepub fn new<E>(
event_loop: &EventLoopWindowTarget<E>,
config: &UiConfig,
identity: &Identity,
wayland_event_queue: Option<&EventQueue>,
x11_visual: Option<X11VisualInfo>
) -> Result<Window, Error>
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.
pub fn raw_window_handle(&self) -> RawWindowHandle
pub fn set_inner_size(&self, size: PhysicalSize<u32>)
pub fn inner_size(&self) -> PhysicalSize<u32>
pub fn set_visible(&self, visibility: bool)
pub fn request_redraw(&self)
pub fn set_mouse_cursor(&mut self, cursor: CursorIcon)
sourcepub fn set_mouse_visible(&mut self, visible: bool)
pub fn set_mouse_visible(&mut self, visible: bool)
Set mouse cursor visible.
pub fn get_platform_window( identity: &Identity, window_config: &WindowConfig, x11_visual: Option<X11VisualInfo> ) -> WindowBuilder
pub fn set_urgent(&self, is_urgent: bool)
pub fn id(&self) -> WindowId
pub fn set_transparent(&self, transparent: bool)
pub fn set_maximized(&self, maximized: bool)
pub fn set_minimized(&self, minimized: bool)
pub fn set_resize_increments(&self, increments: PhysicalSize<f32>)
sourcepub fn toggle_fullscreen(&self)
pub fn toggle_fullscreen(&self)
Toggle the window’s fullscreen state.
sourcepub fn toggle_maximized(&self)
pub fn toggle_maximized(&self)
Toggle the window’s maximized state.
pub fn set_fullscreen(&self, fullscreen: bool)
pub fn current_monitor(&self) -> Option<MonitorHandle>
pub fn wayland_surface(&self) -> Option<&Attached<WlSurface>>
pub fn set_ime_allowed(&self, allowed: bool)
sourcepub fn update_ime_position(&self, point: Point<usize>, size: &SizeInfo)
pub fn update_ime_position(&self, point: Point<usize>, size: &SizeInfo)
Adjust the IME editor position according to the new location of the cursor.