X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef1717a963dfb76bac26b9f4277ae590b3c0a2e6..0c9d7ace58512847c3aa4177c650723b6e971a28:/src/mac/classic/display.cpp diff --git a/src/mac/classic/display.cpp b/src/mac/classic/display.cpp index 61eb2d44e2..91b96a77b6 100644 --- a/src/mac/classic/display.cpp +++ b/src/mac/classic/display.cpp @@ -26,9 +26,13 @@ #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__ @@ -41,10 +45,7 @@ #include #endif -#include "wx/display.h" #include "wx/display_impl.h" -#include "wx/gdicmn.h" -#include "wx/string.h" // ---------------------------------------------------------------------------- // display implementation classes @@ -53,7 +54,11 @@ 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);