Wxwidgets: Allow application to bought to foreground on Mac OS X

This commit is contained in:
Ilari Liusvaara 2011-11-21 04:42:29 +02:00
parent 0a7d6bcdb4
commit d896e8f6e0
3 changed files with 15 additions and 0 deletions

View file

@ -6,6 +6,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;

View file

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

View file

@ -36,6 +36,7 @@ IMPLEMENT_APP(lsnes_app)
bool lsnes_app::OnInit()
{
set_random_seed();
foreground_application();
{
std::ostringstream x;