Macos fullscreen & dialog support with run_return (#1581)

* Fix for fullscreen with run_return on mac

* Cleanup

* Removed a comment

* fmt

* This doesn't break exiting run_return anymore

* Now you can also transition from code

* Fmt & cleanup

* Now using a atomic instead of a static bool

* reinserted a line

* Fmt

* Added support for dialogs and child windows

* Cargo fmt

* Dialogs are now being shutdown properly

* Cargo fmt

* Update CHANGELOG.md
This commit is contained in:
Viktor Zoutman 2020-06-09 23:46:33 +02:00 committed by GitHub
parent a4121a2c2e
commit 5a6cfc314e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 20 deletions

View file

@ -19,6 +19,7 @@ use crate::{
platform::macos::{ActivationPolicy, RequestUserAttentionType, WindowExtMacOS},
platform_impl::platform::{
app_state::AppState,
app_state::INTERRUPT_EVENT_LOOP_EXIT,
ffi,
monitor::{self, MonitorHandle, VideoMode},
util::{self, IdRef},
@ -820,6 +821,8 @@ impl UnownedWindow {
shared_state_lock.fullscreen = fullscreen.clone();
trace!("Unlocked shared state in `set_fullscreen`");
INTERRUPT_EVENT_LOOP_EXIT.store(true, Ordering::SeqCst);
match (&old_fullscreen, &fullscreen) {
(&None, &Some(_)) => unsafe {
util::toggle_full_screen_async(
@ -865,7 +868,7 @@ impl UnownedWindow {
) => unsafe {
util::restore_display_mode_async(video_mode.monitor().inner.native_identifier());
},
_ => (),
_ => INTERRUPT_EVENT_LOOP_EXIT.store(false, Ordering::SeqCst),
}
}