From f704c40207df2b518ed5105c23ea1cd2199291f4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 4 Oct 2018 16:31:55 +0200 Subject: [PATCH] Don't use wxDisplayFactorySingleX11 in wxGTK if wxUSE_DISPLAY==0 wxDisplay::CreateFactory() shouldn't be defined in this file when building wxGTK, whether wxUSE_DISPLAY==1 or 0. --- src/unix/displayx11.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 93113a4886..7c376bf83c 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -370,6 +370,7 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) #endif // !__WXGTK20__ #endif // !HAVE_X11_EXTENSIONS_XF86VMODE_H #endif // !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) +#endif // wxUSE_DISPLAY // ============================================================================ // wxDisplay::CreateFactory() @@ -378,21 +379,14 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) #ifndef __WXGTK20__ /* static */ wxDisplayFactory *wxDisplay::CreateFactory() { - if ( !XineramaIsActive((Display*)wxGetDisplay()) ) - return new wxDisplayFactorySingleX11; +#if wxUSE_DISPLAY + if ( XineramaIsActive((Display*)wxGetDisplay()) ) + return new wxDisplayFactoryX11; +#endif // wxUSE_DISPLAY - return new wxDisplayFactoryX11; -} -#endif - -#else // !wxUSE_DISPLAY - -/* static */ wxDisplayFactory *wxDisplay::CreateFactory() -{ return new wxDisplayFactorySingleX11; } - -#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY +#endif #if !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height)