diff --git a/aegisub/src/dialog_manager.h b/aegisub/src/dialog_manager.h index 3d8222ac7..f8b873ec8 100644 --- a/aegisub/src/dialog_manager.h +++ b/aegisub/src/dialog_manager.h @@ -25,6 +25,8 @@ #include #endif +#include "utils.h" + /// @brief A manager for dialogs /// /// DialogManager keeps track of modal and modeless dialogs which have been @@ -74,6 +76,7 @@ public: created_dialogs[&typeid(DialogType)] = d; d->Bind(wxEVT_CLOSE_WINDOW, &DialogManager::OnClose, this); d->Show(); + SetFloatOnParent(d); } catch (agi::UserCancelException const&) { } } diff --git a/aegisub/src/osx_utils.mm b/aegisub/src/osx_utils.mm index 76da12f39..bd6ec0ee6 100644 --- a/aegisub/src/osx_utils.mm +++ b/aegisub/src/osx_utils.mm @@ -36,3 +36,7 @@ void AddFullScreenButton(wxWindow *window) { collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; [nsWindow setCollectionBehavior:collectionBehavior]; } + +void SetFloatOnParent(wxWindow *window) { + [[window->GetHandle() window] setLevel:NSFloatingWindowLevel]; +} diff --git a/aegisub/src/utils.cpp b/aegisub/src/utils.cpp index 4ea11593b..8b4a30fe5 100644 --- a/aegisub/src/utils.cpp +++ b/aegisub/src/utils.cpp @@ -424,6 +424,6 @@ void CleanCache(wxString const& directory, wxString const& file_type, int64_t ma // OS X implementation in osx_utils.mm #ifndef __WXOSX_COCOA__ -void AddFullScreenButton(wxWindow *window) { -} +void AddFullScreenButton(wxWindow *) { } +void SetFloatOnParent(wxWindow *) { } #endif diff --git a/aegisub/src/utils.h b/aegisub/src/utils.h index bf45723a8..763b9e0f9 100644 --- a/aegisub/src/utils.h +++ b/aegisub/src/utils.h @@ -97,6 +97,8 @@ void RestartAegisub(); /// Add the OS X 10.7+ full-screen button to a window void AddFullScreenButton(wxWindow *window); +void SetFloatOnParent(wxWindow *window); + /// Forward a mouse wheel event to the window under the mouse if needed /// @param source The initial target of the wheel event /// @param evt The event