From d5a20ebb32b14f0191faa537cf044394b7b67bf6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Sep 2006 17:34:32 +0000 Subject: [PATCH] only return matching modes from GetModes() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/displayx11.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 1d71c7f038..3f04ced7e5 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -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; -- 2.45.2