Fix panic when using FullScreenExclusive::ApplicationControlled (#2579)

This commit is contained in:
marc0246 2024-10-16 19:53:15 +02:00 committed by GitHub
parent 52fc88abef
commit 8c08a85a18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -491,7 +491,7 @@ impl Swapchain {
Self::new_inner_unchecked(&self.device, &self.surface, &create_info, Some(self))?
};
let (mut swapchain, swapchain_images) = Self::from_handle(
let (swapchain, swapchain_images) = Self::from_handle(
self.device.clone(),
handle,
image_handles,
@ -500,10 +500,10 @@ impl Swapchain {
)?;
if self.full_screen_exclusive == FullScreenExclusive::ApplicationControlled {
Arc::get_mut(&mut swapchain)
.unwrap()
.full_screen_exclusive_held =
AtomicBool::new(self.full_screen_exclusive_held.load(Ordering::Relaxed))
swapchain.full_screen_exclusive_held.store(
self.full_screen_exclusive_held.load(Ordering::Relaxed),
Ordering::Relaxed,
);
};
Ok((swapchain, swapchain_images))