Merge remote-tracking branch 'origin/mac-foreground-fix' into mfgf
This commit is contained in:
commit
1e22030a1b
3 changed files with 15 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
wxString towxstring(const std::string& str);
|
||||
std::string tostdstring(const wxString& str);
|
||||
void foreground_application();
|
||||
extern long primary_window_style;
|
||||
extern long secondary_window_style;
|
||||
typedef wxStaticText* wxStaticText_ptr;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include "plat-wxwidgets/common.hpp"
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#endif
|
||||
|
||||
wxString towxstring(const std::string& str)
|
||||
{
|
||||
return wxString(str.c_str(), wxConvUTF8);
|
||||
|
@ -10,6 +14,15 @@ std::string tostdstring(const wxString& str)
|
|||
return std::string(str.mb_str(wxConvUTF8));
|
||||
}
|
||||
|
||||
void foreground_application()
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
ProcessSerialNumber PSN;
|
||||
GetCurrentProcess(&PSN);
|
||||
TransformProcessType(&PSN,kProcessTransformToForegroundApplication);
|
||||
#endif
|
||||
}
|
||||
|
||||
long primary_window_style = wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN | wxCLOSE_BOX;
|
||||
long secondary_window_style = wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ IMPLEMENT_APP(lsnes_app)
|
|||
bool lsnes_app::OnInit()
|
||||
{
|
||||
set_random_seed();
|
||||
foreground_application();
|
||||
|
||||
{
|
||||
std::ostringstream x;
|
||||
|
|
Loading…
Add table
Reference in a new issue