]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/display.cpp
include X11/Xutil.h for wxMotif compilation
[wxWidgets.git] / src / mac / classic / display.cpp
index 61eb2d44e2f4107d0faf55d30af30c2517573dcc..91b96a77b66ecfac3c39d79a039806a961fc8ec5 100644 (file)
 
 #if wxUSE_DISPLAY
 
+#include "wx/display.h"
+
 #ifndef WX_PRECOMP
-   #include "wx/dynarray.h"
-   #include "wx/log.h"
+    #include "wx/dynarray.h"
+    #include "wx/log.h"
+    #include "wx/string.h"
+    #include "wx/gdicmn.h"
 #endif
 
 #ifdef __DARWIN__
     #include <FixMath.h>
 #endif
 
-#include "wx/display.h"
 #include "wx/display_impl.h"
-#include "wx/gdicmn.h"
-#include "wx/string.h"
 
 // ----------------------------------------------------------------------------
 // display implementation classes
 class wxDisplayImplMac : public wxDisplayImpl
 {
 public:
-    wxDisplayImplMac(GDHandle hndl) : m_hndl(hndl) { }
+    wxDisplayImplMac(size_t n, GDHandle hndl)
+        : wxDisplayImpl(n),
+          m_hndl(hndl)
+    {
+    }
 
     virtual wxRect GetGeometry() const;
     virtual wxString GetName() const { return wxString(); }
@@ -120,12 +125,14 @@ int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p)
 
 wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n)
 {
+    size_t nOrig = n;
+
     GDHandle hndl = DMGetFirstScreenDevice(true);
     while(hndl)
     {
         if (n == 0)
         {
-            return new wxDisplayImplMac(hndl);
+            return new wxDisplayImplMac(nOrig, hndl);
         }
         n--;
         hndl = DMGetNextScreenDevice(hndl, true);