X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a7a4e10ed18f81a576dcd866cfbf02bf404c00..8e190f0ed9c242e6df5fd4dd99fdaf6c9dea1cda:/src/unix/displayx11.cpp diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 53dba8c959..f08b0bdcae 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -34,10 +34,10 @@ #include "wx/string.h" #include "wx/utils.h" #include "wx/intl.h" + #include "wx/log.h" #endif /* WX_PRECOMP */ #include "wx/display_impl.h" -#include "wx/log.h" /* These must be included after the wx files. Otherwise the Data macro in * Xlibint.h conflicts with a function declaration in wx/list.h. */ @@ -71,7 +71,7 @@ public: operator const XineramaScreenInfo *() const { return m_screens; } - size_t GetCount() const { return wx_static_cast(size_t, m_num); } + unsigned GetCount() const { return wx_static_cast(unsigned, m_num); } private: XineramaScreenInfo *m_screens; @@ -85,7 +85,7 @@ private: class WXDLLEXPORT wxDisplayImplX11 : public wxDisplayImpl { public: - wxDisplayImplX11(size_t n, const XineramaScreenInfo& info) + wxDisplayImplX11(unsigned n, const XineramaScreenInfo& info) : wxDisplayImpl(n), m_rect(info.x_org, info.y_org, info.width, info.height) { @@ -110,8 +110,8 @@ class wxDisplayFactoryX11 : public wxDisplayFactory public: wxDisplayFactoryX11() { } - virtual wxDisplayImpl *CreateDisplay(size_t n); - virtual size_t GetCount(); + virtual wxDisplayImpl *CreateDisplay(unsigned n); + virtual unsigned GetCount(); virtual int GetFromPoint(const wxPoint& pt); protected: @@ -122,7 +122,7 @@ protected: // wxDisplayFactoryX11 implementation // ============================================================================ -size_t wxDisplayFactoryX11::GetCount() +unsigned wxDisplayFactoryX11::GetCount() { return ScreensInfo().GetCount(); } @@ -131,8 +131,8 @@ int wxDisplayFactoryX11::GetFromPoint(const wxPoint& p) { ScreensInfo screens; - const size_t numscreens(screens.GetCount()); - for ( size_t i = 0; i < numscreens; ++i ) + const unsigned numscreens(screens.GetCount()); + for ( unsigned i = 0; i < numscreens; ++i ) { const XineramaScreenInfo& s = screens[i]; if ( p.x >= s.x_org && p.x < s.x_org + s.width && @@ -145,7 +145,7 @@ int wxDisplayFactoryX11::GetFromPoint(const wxPoint& p) return wxNOT_FOUND; } -wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(size_t n) +wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(unsigned n) { ScreensInfo screens; @@ -265,7 +265,7 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& mode) #else // !HAVE_X11_EXTENSIONS_XF86VMODE_H -wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& mode) const +wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& modeMatch) const { int count_return; int* depths = XListDepths((Display*)wxGetDisplay(), 0, &count_return); @@ -274,7 +274,11 @@ wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& mode) const { for ( int x = 0; x < count_return; ++x ) { - modes.Add(wxVideoMode(m_rect.GetWidth(), m_rect.GetHeight(), depths[x])); + wxVideoMode mode(m_rect.GetWidth(), m_rect.GetHeight(), depths[x]); + if ( mode.Matches(modeMatch) ) + { + modes.Add(modeMatch); + } } XFree(depths); @@ -288,7 +292,7 @@ wxVideoMode wxDisplayImplX11::GetCurrentMode() const return wxVideoMode(); } -bool wxDisplayImplX11::ChangeMode(const wxVideoMode& mode) +bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) { // Not implemented return false;