pub struct WindowManager {
pub windows: Vec<Window>,
pub dirty: bool,
pub terminal_focused: bool,
pub active_workspace: u8,
pub slide_out: bool,
pub alt_hold_mode: bool,
pub alt_input_buffer: String,
pub dirty_rects: Vec<Rect>,
last_mouse_x: i32,
last_mouse_y: i32,
last_mouse_btn: bool,
}Fields§
§windows: Vec<Window>§dirty: bool§terminal_focused: bool§active_workspace: u8§slide_out: bool§alt_hold_mode: bool§alt_input_buffer: String§dirty_rects: Vec<Rect>§last_mouse_x: i32§last_mouse_y: i32§last_mouse_btn: boolImplementations§
Source§impl WindowManager
impl WindowManager
pub fn new() -> Self
pub fn add_dirty_rect(&mut self, rect: Rect)
pub fn clear_dirty_rects(&mut self)
pub fn get_dirty_bounding_box( &self, screen_w: u32, screen_h: u32, ) -> Option<Rect>
Sourcepub fn existing_window_state(&self, app_name: &str) -> Option<bool>
pub fn existing_window_state(&self, app_name: &str) -> Option<bool>
同じ名前のウィンドウがあれば (止まっているか) を返す(なければ None)。2026-11-18。
Sourcepub fn open_url_in_existing(&mut self, app_name: &str, url: &str) -> bool
pub fn open_url_in_existing(&mut self, app_name: &str, url: &str) -> bool
既存の app_name のウィンドウを前に出し、url をそのアプリの新しいタブで開かせる(2026-11-18)。
ウィンドウが 1 つだけという決まりは変えない(新しいウィンドウは作らない)。開けたら true。
pub fn add_window(&mut self, win: Window)
pub fn remove_active_window(&mut self)
Sourcepub fn kill_window(&mut self, idx: usize) -> Option<String>
pub fn kill_window(&mut self, idx: usize) -> Option<String>
指定した番号のウィンドウを閉じ、そのアプリを強制終了する(TODO R2)。
アプリのスレッドは、次の確認の所(kill_checkpoint)で終わる。描画や JS の実行の途中でも待たない。
戻り値: 閉じたアプリの名前(番号が範囲外なら None)。
Sourcepub fn kill_tab(&mut self, win_idx: usize, tab_idx: usize) -> Option<String>
pub fn kill_tab(&mut self, win_idx: usize, tab_idx: usize) -> Option<String>
ウィンドウ win_idx のタブ tab_idx だけを止める(TODO R2 (d)、2026-11-18)。ウィンドウとほかのタブは残す。
タブが 1 つしか無ければ、ウィンドウごと止める(Self::kill_window)。
アプリのスレッドへ合図を立てるだけで待たない。そのタブが JS を実行中なら、JS は次の確かめ(32,768 ステップごと)で
打ち切られ、アプリのスレッドが描画から戻った 1 周の頭でタブを閉じる。JS 以外の長い処理(大きなページのレイアウト・
画像の復号など)の途中では、その処理が終わるまで閉じない(そのときはウィンドウごと止める Delete が使える)。
戻り値: 止めるタブの名前(受け付けなかったら None)。
Sourcepub fn activate_window(&mut self, idx: usize)
pub fn activate_window(&mut self, idx: usize)
指定したインデックス of ウィンドウを最前面に移動してアクティブにする
Sourcepub fn any_window_covers_rect(&self, x0: i32, y0: i32, x1: i32, y1: i32) -> bool
pub fn any_window_covers_rect(&self, x0: i32, y0: i32, x1: i32, y1: i32) -> bool
全画面(背景の上にウィンドウ)を描画 (合成ウィンドウマネージャ方式) 指定矩形 (スクリーン座標) を、可視ウィンドウ (アクティブ WS・非最小化) が 少しでも覆っているかを返す。
システムモニタのような「背景レイヤー」要素を部分再描画してよいかの判定に使う。 背景要素はウィンドウより下の z 順にあるため、ウィンドウが覆っている領域へ 単独で描画すると z 順を破ってウィンドウを突き破ってしまう。それを防ぐ。
pub fn draw_all(&mut self, screen: &Screen)
Sourcepub fn handle_mouse(
&mut self,
mx: i32,
my: i32,
btn_left: bool,
btn_right: bool,
wheel: i32,
screen: &Screen,
) -> bool
pub fn handle_mouse( &mut self, mx: i32, my: i32, btn_left: bool, btn_right: bool, wheel: i32, screen: &Screen, ) -> bool
マウスイベント処理。Zオーダー順(手前から)判定する。
Sourcepub fn handle_key(
&mut self,
keycode: u8,
pressed: bool,
ascii: Option<char>,
alt_pressed: bool,
screen: &Screen,
) -> bool
pub fn handle_key( &mut self, keycode: u8, pressed: bool, ascii: Option<char>, alt_pressed: bool, screen: &Screen, ) -> bool
キーボードイベントの処理(ファンクションキーおよびアクティブウィンドウ宛て)
Sourcepub fn needs_timer_redraw(&self) -> bool
pub fn needs_timer_redraw(&self) -> bool
何らかのアクティブなウィンドウがタイマー再描画を要求しているか