Skip to main content

WindowManager

Struct WindowManager 

Source
pub struct WindowManager { /* private fields */ }
Expand description

Manages multiple terminal windows and shared resources

Implementations§

Source§

impl WindowManager

Source

pub fn new( config: Config, runtime: Arc<Runtime>, runtime_options: RuntimeOptions, ) -> Self

Create a new window manager

Source

pub fn get_focused_window_id(&self) -> Option<WindowId>

Get the ID of the currently focused window. Returns the window with is_focused == true, or falls back to the first window if none is focused.

Source

pub fn check_cli_timers(&mut self)

Check and handle timing-based CLI options (exit-after, screenshot, command)

Source

pub fn check_for_updates(&mut self)

Check for updates (called periodically from about_to_wait)

Source

pub fn force_update_check(&mut self)

Force an immediate update check (triggered from UI)

Source

pub fn force_update_check_for_settings(&mut self)

Force an update check and sync the result to the settings window.

Source

pub fn create_window(&mut self, event_loop: &ActiveEventLoop)

Create a new window with a fresh terminal session

Source

pub fn close_window(&mut self, window_id: WindowId)

Close a specific window

Source

pub fn restore_session(&mut self, event_loop: &ActiveEventLoop) -> bool

Restore windows from the last saved session

Returns true if session was successfully restored, false otherwise.

Source

pub fn get_window_mut( &mut self, window_id: WindowId, ) -> Option<&mut WindowState>

Get mutable reference to a window’s state

Source

pub fn get_window(&self, window_id: WindowId) -> Option<&WindowState>

Get reference to a window’s state

Source

pub fn handle_menu_action( &mut self, action: MenuAction, event_loop: &ActiveEventLoop, focused_window: Option<WindowId>, )

Handle a menu action

Source

pub fn process_menu_events( &mut self, event_loop: &ActiveEventLoop, focused_window: Option<WindowId>, )

Process any pending menu events

Source

pub fn open_settings_window(&mut self, event_loop: &ActiveEventLoop)

Open the settings window (or focus if already open)

Source

pub fn close_settings_window(&mut self)

Close the settings window

Source

pub fn is_settings_window(&self, window_id: WindowId) -> bool

Check if a window ID belongs to the settings window

Source

pub fn handle_settings_window_event( &mut self, event: WindowEvent, ) -> Option<SettingsWindowAction>

Handle an event for the settings window

Source

pub fn apply_config_to_windows(&mut self, config: &Config)

Apply config changes from settings window to all terminal windows

Source

pub fn apply_shader_from_editor(&mut self, source: &str) -> Result<(), String>

Apply shader changes from settings window editor

Source

pub fn apply_cursor_shader_from_editor( &mut self, source: &str, ) -> Result<(), String>

Apply cursor shader changes from settings window editor

Source

pub fn request_settings_redraw(&self)

Request redraw for settings window

Source

pub fn start_coprocess(&mut self, config_index: usize)

Start a coprocess by config index on the focused window’s active tab.

Source

pub fn stop_coprocess(&mut self, config_index: usize)

Stop a coprocess by config index on the focused window’s active tab.

Source

pub fn sync_coprocess_running_state(&mut self)

Sync coprocess running state to the settings window.

Source

pub fn start_script(&mut self, config_index: usize)

Start a script by config index on the focused window’s active tab.

Source

pub fn stop_script(&mut self, config_index: usize)

Stop a script by config index on the focused window’s active tab.

Source

pub fn sync_script_running_state(&mut self)

Sync script running state to the settings window.

Drains events from forwarders, sends them to scripts, reads commands and errors back, and updates the settings UI state.

Source

pub fn create_window_with_overrides( &mut self, event_loop: &ActiveEventLoop, position: (i32, i32), size: (u32, u32), tab_cwds: &[Option<String>], active_tab_index: usize, )

Create a new window with specific position and size overrides.

Unlike create_window(), this skips apply_window_positioning() and places the window at the exact specified position and size. Additional tabs (beyond the first) are created with the given CWDs.

Source

pub fn save_arrangement(&mut self, name: String, event_loop: &ActiveEventLoop)

Save the current window layout as an arrangement

Source

pub fn restore_arrangement( &mut self, id: ArrangementId, event_loop: &ActiveEventLoop, )

Restore a saved arrangement by ID.

Closes all existing windows and creates new ones according to the arrangement.

Source

pub fn restore_arrangement_by_name( &mut self, name: &str, event_loop: &ActiveEventLoop, ) -> bool

Restore an arrangement by name (for auto-restore and keybinding actions)

Source

pub fn delete_arrangement(&mut self, id: ArrangementId)

Delete an arrangement by ID

Source

pub fn rename_arrangement(&mut self, id: ArrangementId, new_name: String)

Rename an arrangement by ID

Source

pub fn move_arrangement_up(&mut self, id: ArrangementId)

Move an arrangement up in the order

Source

pub fn move_arrangement_down(&mut self, id: ArrangementId)

Move an arrangement down in the order

Source

pub fn sync_arrangements_to_settings(&mut self)

Sync arrangement manager data to the settings window (for UI display)

Source

pub fn send_test_notification(&self)

Trait Implementations§

Source§

impl ApplicationHandler for WindowManager

Source§

fn resumed(&mut self, event_loop: &ActiveEventLoop)

Emitted when the application has been resumed. Read more
Source§

fn window_event( &mut self, event_loop: &ActiveEventLoop, window_id: WindowId, event: WindowEvent, )

Emitted when the OS sends an event to a winit window.
Source§

fn about_to_wait(&mut self, event_loop: &ActiveEventLoop)

Emitted when the event loop is about to block and wait for new events. Read more
Source§

fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)

Emitted when new events arrive from the OS to be processed. Read more
Source§

fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)

Emitted when an event is sent from EventLoopProxy::send_event.
Source§

fn device_event( &mut self, event_loop: &ActiveEventLoop, device_id: DeviceId, event: DeviceEvent, )

Emitted when the OS sends an event to a device.
Source§

fn suspended(&mut self, event_loop: &ActiveEventLoop)

Emitted when the application has been suspended. Read more
Source§

fn exiting(&mut self, event_loop: &ActiveEventLoop)

Emitted when the event loop is being shut down. Read more
Source§

fn memory_warning(&mut self, event_loop: &ActiveEventLoop)

Emitted when the application has received a memory warning. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

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

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>) -> Rc<dyn Any>

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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 T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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

Source§

fn upcast(&self) -> Option<&T>

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
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,