osx: Make modelss dialogs stay on top of the main window as they're floating panels, not documents

Originally committed to SVN as r6889.
This commit is contained in:
Thomas Goyne 2012-06-07 02:48:13 +00:00
parent 26a5fbe4b8
commit f0f7ad2858
4 changed files with 11 additions and 2 deletions

View file

@ -25,6 +25,8 @@
#include <wx/dialog.h>
#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&) { }
}

View file

@ -36,3 +36,7 @@ void AddFullScreenButton(wxWindow *window) {
collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary;
[nsWindow setCollectionBehavior:collectionBehavior];
}
void SetFloatOnParent(wxWindow *window) {
[[window->GetHandle() window] setLevel:NSFloatingWindowLevel];
}

View file

@ -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

View file

@ -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