don't skip first/last node when pressing down/up arrow after opening the menu with...
[wxWidgets.git] / src / msw / utils.cpp
index da2a1378574601e7f71daacf3964340e34af50a3..34b1ee859ae625abbfb6a197eb91824b7e1e6556 100644 (file)
@@ -61,9 +61,10 @@ extern "C" {
     #endif
 #endif  //GNUWIN32
 
-#if defined(__GNUWIN32__) && !defined(__TWIN32__)
+#if defined(__CYGWIN__) && !defined(__TWIN32__)
     #include <sys/unistd.h>
     #include <sys/stat.h>
+    #include <sys/cygwin.h> // for cygwin_conv_to_full_win32_path()
 #endif  //GNUWIN32
 
 #ifdef __BORLANDC__ // Please someone tell me which version of Borland needs
@@ -372,6 +373,13 @@ const wxChar* wxGetHomeDir(wxString *pstr)
     // add a trailing slash if needed
     if ( strDir.Last() != wxT('/') )
       strDir << wxT('/');
+
+    #ifdef __CYGWIN__
+      // Cygwin returns unix type path but that does not work well
+      static wxChar windowsPath[MAX_PATH];
+      cygwin_conv_to_full_win32_path(strDir, windowsPath);
+      strDir = windowsPath;
+    #endif
   #else   // Windows
     #ifdef  __WIN32__
       const wxChar *szHome = wxGetenv(wxT("HOMEDRIVE"));