Skip to content

Commit

Permalink
fix(iced-sctk): handle exit_on_close_request
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Oct 6, 2023
1 parent 271a943 commit 12d8515
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sctk/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async fn run_instance<A, E, C>(
mut auto_size_surfaces: HashMap<SurfaceIdWrapper, (u32, u32, Limits, bool)>,
backend: wayland_backend::client::Backend,
init_command: Command<A::Message>,
_exit_on_close_request: bool, // TODO Ashley
exit_on_close_request: bool,
queue_handle: QueueHandle<SctkState<<A as Program>::Message>>,
) -> Result<(), Error>
where
Expand Down Expand Up @@ -496,9 +496,9 @@ where
messages.push(application.close_requested(surface_id.inner()));
destroyed_surface_ids.insert(id.id(), surface_id);
compositor_surfaces.remove(&surface_id.inner());
// if exit_on_close_request && surface_id == init_id {
// break 'main;
// }
if exit_on_close_request && compositor_surfaces.is_empty() {
break 'main;
}
}
}
crate::sctk_event::WindowEventVariant::WmCapabilities(_)
Expand Down Expand Up @@ -584,9 +584,9 @@ where
messages.push(application.close_requested(surface_id.inner()));
destroyed_surface_ids.insert(id.id(), surface_id);
compositor_surfaces.remove(&surface_id.inner());
// if exit_on_close_request && surface_id == init_id {
// break 'main;
// }
if exit_on_close_request && compositor_surfaces.is_empty() {
break 'main;
}
}
}
LayerSurfaceEventVariant::Configure(configure, wl_surface, first) => {
Expand Down

0 comments on commit 12d8515

Please sign in to comment.