diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index c8a9605538..fdb3ae6399 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -159,7 +159,58 @@ wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(unsigned n) return n < screens.GetCount() ? new wxDisplayImplX11(n, screens[n]) : NULL; } -#endif // !__WXGTK20__ +#else // __WXGTK20__ + +// Provide stubs for the functions which were (wrongly!) part of ABI in 3.0.0. +// They should never be actually used by anybody, but still keep them present, +// just to be certain we don't prevent some programs referencing, but not +// using, them from running with later 3.0.x versions. +class WXDLLEXPORT wxDisplayImplX11 : public wxDisplayImpl +{ +public: + wxDisplayImplX11(unsigned n) : wxDisplayImpl(n) { } + + // These are inline because they were inline in 3.0.0 too. + virtual wxRect GetGeometry() const { return wxRect(); } + virtual wxRect GetClientArea() const { return wxRect(); } + virtual wxString GetName() const { return wxString(); } + + // And those were not. + virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const; + virtual wxVideoMode GetCurrentMode() const; + virtual bool ChangeMode(const wxVideoMode& mode); + +private: + // We must also have the same data fields as in 3.0.0, even if they are + // unused, to avoid ABI checker warnings. + wxRect m_rect; + int m_depth; +}; + +wxArrayVideoModes +wxDisplayImplX11::GetModes(const wxVideoMode& WXUNUSED(mode)) const +{ + return wxArrayVideoModes(); +} + +wxVideoMode wxDisplayImplX11::GetCurrentMode() const +{ + return wxVideoMode(); +} + +bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) +{ + return false; +} + +// We need to reference this class, otherwise our stubs will be simply +// discarded. Notice that this function just needs to exist, not be called. +extern wxDisplayImpl* wxDisplayImplX11Use(unsigned n) +{ + return new wxDisplayImplX11(n); +} + +#endif // !__WXGTK20__/__WXGTK20__ // ============================================================================ // wxDisplayImplX11 implementation