]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
Applied patch [ 816021 ] SetFont without m_widget
[wxWidgets.git] / src / mac / carbon / app.cpp
index 2ff6ed261db929a64e3a4aa4adb7c55b1219e763..0c8413941f4efb50b6e490385bd01b6b8b1a898e 100644 (file)
@@ -69,6 +69,7 @@
 extern wxList wxPendingDelete;
 extern wxList *wxWinMacWindowList;
 extern wxList *wxWinMacControlList;
+extern size_t g_numberOfThreads;
 
 // statics for implementation
 
@@ -810,7 +811,11 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
 
             // allocate copy to replace .dylib.* extension with .rsrc
             if (theLibPath != NULL) {
-                theResPath = theLibPath;
+#if wxUSE_UNICODE
+                theResPath = wxString(theLibPath, wxConvLocal);
+#else
+                theResPath = wxString(theLibPath);
+#endif
                 // replace '_core' with '' in case of multi-lib build
                 theResPath.Replace(wxT("_core"), wxEmptyString);
                 // replace ".dylib" shared library extension with ".rsrc"
@@ -836,9 +841,8 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
                 }
                 if (theErr != noErr) {
 #ifdef __WXDEBUG__
-                    fprintf(stderr,
-                            wxT("unable to open wxMac resource file '%s'\n"),
-                            theResPath.mb_str() );
+                    wxLogDebug( wxT("unable to open wxMac resource file '%s'\n"),
+                                theResPath.mb_str() );
 #endif // __WXDEBUG__
                 }
 
@@ -1250,7 +1254,16 @@ void wxApp::MacDoOneEvent()
         if ( wxTheApp->ProcessIdle() )
             sleepTime = kEventDurationNoWait ;
         else
-            sleepTime = kEventDurationForever ;
+        {
+            if (g_numberOfThreads)
+            {
+                sleepTime = kEventDurationNoWait;
+            }
+            else
+            {
+                sleepTime = kEventDurationSecond;
+            }
+        }
     }
     else if ( status == eventLoopQuitErr )
     {
@@ -1284,7 +1297,16 @@ void wxApp::MacDoOneEvent()
         if ( wxTheApp->ProcessIdle() )
             sleepTime = kEventDurationNoWait;
         else
-            sleepTime = GetCaretTime() / 2 ;
+        {
+            if (g_numberOfThreads)
+            {
+                sleepTime = kEventDurationNoWait;
+            }
+            else
+            {
+                sleepTime = kEventDurationSecond;
+            }
+        }
     }
     if ( event.what != kHighLevelEvent )
         SetRectRgn( (RgnHandle) s_macCursorRgn , event.where.h , event.where.v ,  event.where.h + 1 , event.where.v + 1 ) ;