wip: move desktop to main thread and use tokio main

This commit is contained in:
Jonathan Kelley committed 2022-12-29 17:11:29 -05:00
1 parent 6a4979b574
commit ff697d41e3
4 files changed
+218 -141

No files matched your search

+9 -1
View File
@@ -175,6 +175,8 @@ pub enum UserWindowEvent {
EditsReady,
Initialize,
Poll,
CloseWindow,
DragWindow,
FocusWindow,
@@ -226,7 +228,9 @@ impl DesktopController {
let window = webview.window();
match user_event {
Initialize | EditsReady => self.try_load_ready_webviews(),
Initialize | EditsReady => {
// self.try_load_ready_webviews();
}
CloseWindow => *control_flow = ControlFlow::Exit,
DragWindow => {
// if the drag_window has any errors, we don't do anything
@@ -268,6 +272,10 @@ impl DesktopController {
SetZoomLevel(scale_factor) => webview.zoom(scale_factor),
SetInnerSize(logical_size) => window.set_inner_size(logical_size),
Poll => {
// todo
}
Print => {
if let Err(e) = webview.print() {
// we can't panic this error.