feat: bound scene visibility rendering and continuous native input
This commit is contained in:
+30
-20
@@ -69,8 +69,24 @@ impl TesseraApp {
|
||||
proxy: EventLoopProxy<AppEvent>,
|
||||
control: crate::api::RuntimeControl,
|
||||
) -> anyhow::Result<Self> {
|
||||
let event_client = crate::events::Client::new(proxy.clone())?;
|
||||
Ok(Self {
|
||||
let event_client = crate::events::Client::new(proxy.clone(), namespace.clone())?;
|
||||
Ok(Self::with_event_client(
|
||||
namespace,
|
||||
activity,
|
||||
proxy,
|
||||
control,
|
||||
event_client,
|
||||
))
|
||||
}
|
||||
|
||||
fn with_event_client(
|
||||
namespace: Arc<RwLock<NamespaceState>>,
|
||||
activity: Activity,
|
||||
proxy: EventLoopProxy<AppEvent>,
|
||||
control: crate::api::RuntimeControl,
|
||||
event_client: crate::events::Client,
|
||||
) -> Self {
|
||||
Self {
|
||||
resource: crate::window::MAIN_WINDOW,
|
||||
control,
|
||||
exit_requested: false,
|
||||
@@ -99,7 +115,7 @@ impl TesseraApp {
|
||||
guest_focus: None,
|
||||
guest_key: None,
|
||||
guest_keyboard: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn reconcile_windows(&mut self, event_loop: &ActiveEventLoop) {
|
||||
@@ -147,28 +163,22 @@ impl TesseraApp {
|
||||
submission,
|
||||
..NamespaceState::default()
|
||||
}));
|
||||
match Self::new(
|
||||
let mut child = Self::with_event_client(
|
||||
namespace,
|
||||
self.activity.clone(),
|
||||
self.proxy.clone(),
|
||||
self.control.clone(),
|
||||
) {
|
||||
Ok(mut child) => {
|
||||
child.resource = id;
|
||||
child.native_session = session;
|
||||
child.resumed(event_loop);
|
||||
if let Some(error) = &child.native_error {
|
||||
self.developer_tools.input_error = error.clone();
|
||||
self.developer_tools.open = true;
|
||||
}
|
||||
child.document_updated(event_loop);
|
||||
self.children.insert(id, child);
|
||||
}
|
||||
Err(error) => {
|
||||
self.developer_tools.input_error = format!("Window {id}: {error}");
|
||||
self.developer_tools.open = true;
|
||||
}
|
||||
self.event_client.clone(),
|
||||
);
|
||||
child.resource = id;
|
||||
child.native_session = session;
|
||||
child.resumed(event_loop);
|
||||
if let Some(error) = &child.native_error {
|
||||
self.developer_tools.input_error = error.clone();
|
||||
self.developer_tools.open = true;
|
||||
}
|
||||
child.document_updated(event_loop);
|
||||
self.children.insert(id, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user