mux: fix an issue where auth window would linger before closing

Same vein as 8931afba5cee07ab12990f06c2ff34d6f8426b19; the auth
window could sometimes get stuck until an input event was sent
to it.

Wire up a mux event so that the window can close itself.
This commit is contained in:
Wez Furlong committed 2021-05-31 00:11:47 -07:00
1 parent 87cb593554
commit 5359f39dcf
4 files changed
+11 -1

No files matched your search

+2
View File
@@ -38,6 +38,7 @@ pub enum MuxNotification {
PaneOutput(PaneId),
PaneRemoved(PaneId),
WindowCreated(WindowId),
WindowRemoved(WindowId),
WindowInvalidated(WindowId),
Alert {
pane_id: PaneId,
@@ -411,6 +412,7 @@ impl Mux {
for tab in window.iter() {
self.remove_tab_internal(tab.tab_id());
}
self.notify(MuxNotification::WindowRemoved(window_id));
}
}
+1
View File
@@ -38,6 +38,7 @@ impl GuiFrontEnd {
})
.detach();
}
MuxNotification::WindowRemoved(_) => {}
MuxNotification::PaneRemoved(_) => {}
MuxNotification::WindowInvalidated(_) => {}
MuxNotification::PaneOutput(_) => {}
+7 -1
View File
@@ -769,6 +769,11 @@ impl TermWindow {
MuxNotification::WindowInvalidated(_) => {
window.invalidate();
}
MuxNotification::WindowRemoved(window_id) => {
if window_id == self.mux_window_id {
window.close();
}
}
_ => {}
},
TermWindowNotif::EmitStatusUpdate => {
@@ -864,7 +869,8 @@ impl TermWindow {
}
let _ = pane_id;
}
MuxNotification::WindowInvalidated(window_id) => {
MuxNotification::WindowRemoved(window_id)
| MuxNotification::WindowInvalidated(window_id) => {
if window_id != mux_window_id {
return true;
}
+1
View File
@@ -95,6 +95,7 @@ where
}
handler.schedule_pane_push(pane_id);
}
Ok(Item::Notif(MuxNotification::WindowRemoved(_window_id))) => {}
Ok(Item::Notif(MuxNotification::WindowCreated(_window_id))) => {}
Ok(Item::Notif(MuxNotification::WindowInvalidated(_window_id))) => {}
Ok(Item::Notif(MuxNotification::Empty)) => {}