pub struct WindowManager { /* private fields */ }Expand description
Manages multiple terminal windows and shared resources
Implementations§
Source§impl WindowManager
impl WindowManager
Sourcepub fn new(
config: Config,
runtime: Arc<Runtime>,
runtime_options: RuntimeOptions,
) -> Self
pub fn new( config: Config, runtime: Arc<Runtime>, runtime_options: RuntimeOptions, ) -> Self
Create a new window manager
Sourcepub fn get_focused_window_id(&self) -> Option<WindowId>
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.
Sourcepub fn check_cli_timers(&mut self)
pub fn check_cli_timers(&mut self)
Check and handle timing-based CLI options (exit-after, screenshot, command)
Sourcepub fn check_for_updates(&mut self)
pub fn check_for_updates(&mut self)
Check for updates (called periodically from about_to_wait)
Sourcepub fn force_update_check(&mut self)
pub fn force_update_check(&mut self)
Force an immediate update check (triggered from UI)
Sourcepub fn force_update_check_for_settings(&mut self)
pub fn force_update_check_for_settings(&mut self)
Force an update check and sync the result to the settings window.
Sourcepub fn create_window(&mut self, event_loop: &ActiveEventLoop)
pub fn create_window(&mut self, event_loop: &ActiveEventLoop)
Create a new window with a fresh terminal session
Sourcepub fn close_window(&mut self, window_id: WindowId)
pub fn close_window(&mut self, window_id: WindowId)
Close a specific window
Sourcepub fn restore_session(&mut self, event_loop: &ActiveEventLoop) -> bool
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.
Sourcepub fn get_window_mut(
&mut self,
window_id: WindowId,
) -> Option<&mut WindowState>
pub fn get_window_mut( &mut self, window_id: WindowId, ) -> Option<&mut WindowState>
Get mutable reference to a window’s state
Sourcepub fn get_window(&self, window_id: WindowId) -> Option<&WindowState>
pub fn get_window(&self, window_id: WindowId) -> Option<&WindowState>
Get reference to a window’s state
Handle a menu action
Process any pending menu events
Sourcepub fn open_settings_window(&mut self, event_loop: &ActiveEventLoop)
pub fn open_settings_window(&mut self, event_loop: &ActiveEventLoop)
Open the settings window (or focus if already open)
Sourcepub fn close_settings_window(&mut self)
pub fn close_settings_window(&mut self)
Close the settings window
Sourcepub fn is_settings_window(&self, window_id: WindowId) -> bool
pub fn is_settings_window(&self, window_id: WindowId) -> bool
Check if a window ID belongs to the settings window
Sourcepub fn handle_settings_window_event(
&mut self,
event: WindowEvent,
) -> Option<SettingsWindowAction>
pub fn handle_settings_window_event( &mut self, event: WindowEvent, ) -> Option<SettingsWindowAction>
Handle an event for the settings window
Sourcepub fn apply_config_to_windows(&mut self, config: &Config)
pub fn apply_config_to_windows(&mut self, config: &Config)
Apply config changes from settings window to all terminal windows
Sourcepub fn apply_shader_from_editor(&mut self, source: &str) -> Result<(), String>
pub fn apply_shader_from_editor(&mut self, source: &str) -> Result<(), String>
Apply shader changes from settings window editor
Sourcepub fn apply_cursor_shader_from_editor(
&mut self,
source: &str,
) -> Result<(), String>
pub fn apply_cursor_shader_from_editor( &mut self, source: &str, ) -> Result<(), String>
Apply cursor shader changes from settings window editor
Sourcepub fn request_settings_redraw(&self)
pub fn request_settings_redraw(&self)
Request redraw for settings window
Sourcepub fn start_coprocess(&mut self, config_index: usize)
pub fn start_coprocess(&mut self, config_index: usize)
Start a coprocess by config index on the focused window’s active tab.
Sourcepub fn stop_coprocess(&mut self, config_index: usize)
pub fn stop_coprocess(&mut self, config_index: usize)
Stop a coprocess by config index on the focused window’s active tab.
Sourcepub fn sync_coprocess_running_state(&mut self)
pub fn sync_coprocess_running_state(&mut self)
Sync coprocess running state to the settings window.
Sourcepub fn start_script(&mut self, config_index: usize)
pub fn start_script(&mut self, config_index: usize)
Start a script by config index on the focused window’s active tab.
Sourcepub fn stop_script(&mut self, config_index: usize)
pub fn stop_script(&mut self, config_index: usize)
Stop a script by config index on the focused window’s active tab.
Sourcepub fn sync_script_running_state(&mut self)
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.
Sourcepub fn create_window_with_overrides(
&mut self,
event_loop: &ActiveEventLoop,
position: (i32, i32),
size: (u32, u32),
tab_cwds: &[Option<String>],
active_tab_index: usize,
)
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.
Sourcepub fn save_arrangement(&mut self, name: String, event_loop: &ActiveEventLoop)
pub fn save_arrangement(&mut self, name: String, event_loop: &ActiveEventLoop)
Save the current window layout as an arrangement
Sourcepub fn restore_arrangement(
&mut self,
id: ArrangementId,
event_loop: &ActiveEventLoop,
)
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.
Sourcepub fn restore_arrangement_by_name(
&mut self,
name: &str,
event_loop: &ActiveEventLoop,
) -> bool
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)
Sourcepub fn delete_arrangement(&mut self, id: ArrangementId)
pub fn delete_arrangement(&mut self, id: ArrangementId)
Delete an arrangement by ID
Sourcepub fn rename_arrangement(&mut self, id: ArrangementId, new_name: String)
pub fn rename_arrangement(&mut self, id: ArrangementId, new_name: String)
Rename an arrangement by ID
Sourcepub fn move_arrangement_up(&mut self, id: ArrangementId)
pub fn move_arrangement_up(&mut self, id: ArrangementId)
Move an arrangement up in the order
Sourcepub fn move_arrangement_down(&mut self, id: ArrangementId)
pub fn move_arrangement_down(&mut self, id: ArrangementId)
Move an arrangement down in the order
Sourcepub fn sync_arrangements_to_settings(&mut self)
pub fn sync_arrangements_to_settings(&mut self)
Sync arrangement manager data to the settings window (for UI display)
pub fn send_test_notification(&self)
Trait Implementations§
Source§impl ApplicationHandler for WindowManager
impl ApplicationHandler for WindowManager
Source§fn resumed(&mut self, event_loop: &ActiveEventLoop)
fn resumed(&mut self, event_loop: &ActiveEventLoop)
Source§fn window_event(
&mut self,
event_loop: &ActiveEventLoop,
window_id: WindowId,
event: WindowEvent,
)
fn window_event( &mut self, event_loop: &ActiveEventLoop, window_id: WindowId, event: WindowEvent, )
Source§fn about_to_wait(&mut self, event_loop: &ActiveEventLoop)
fn about_to_wait(&mut self, event_loop: &ActiveEventLoop)
Source§fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
Source§fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)
fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)
EventLoopProxy::send_event.Source§fn device_event(
&mut self,
event_loop: &ActiveEventLoop,
device_id: DeviceId,
event: DeviceEvent,
)
fn device_event( &mut self, event_loop: &ActiveEventLoop, device_id: DeviceId, event: DeviceEvent, )
Source§fn suspended(&mut self, event_loop: &ActiveEventLoop)
fn suspended(&mut self, event_loop: &ActiveEventLoop)
Source§fn exiting(&mut self, event_loop: &ActiveEventLoop)
fn exiting(&mut self, event_loop: &ActiveEventLoop)
Source§fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
Auto Trait Implementations§
impl !Freeze for WindowManager
impl !RefUnwindSafe for WindowManager
impl !Send for WindowManager
impl !Sync for WindowManager
impl Unpin for WindowManager
impl UnsafeUnpin for WindowManager
impl !UnwindSafe for WindowManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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