From kde-commits Wed Aug 12 09:39:42 2015 From: =?utf-8?q?Martin_Gr=C3=A4=C3=9Flin?= Date: Wed, 12 Aug 2015 09:39:42 +0000 To: kde-commits Subject: [kwin] /: Make X11_XCB a build dependency of X11 windowed backend Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=143937239628918 Git commit 5d946e37629b56be5b57931c1a3f0463dc8bd913 by Martin Gr=C3=A4=C3= =9Flin. Committed on 12/08/2015 at 09:39. Pushed by graesslin into branch 'master'. Make X11_XCB a build dependency of X11 windowed backend Let's rather not build the plugin if we don't have the dependency then building it without OpenGL support. Simplifies the code a bit and makes the backend overall more useful and goes along with e.g. the Wayland one which has EGL also as a hard dependency for the plugin. REVIEW: 124697 M +1 -1 CMakeLists.txt M +3 -1 backends/CMakeLists.txt M +1 -4 backends/x11/CMakeLists.txt M +0 -13 backends/x11/x11windowed_backend.cpp http://commits.kde.org/kwin/5d946e37629b56be5b57931c1a3f0463dc8bd913 diff --git a/CMakeLists.txt b/CMakeLists.txt index c1b9c6c..5687720 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,7 +208,7 @@ add_feature_info("XCB-ICCCM" XCB_ICCCM_FOUND "Required = for building test applica = find_package(X11_XCB) set_package_properties(X11_XCB PROPERTIES - PURPOSE "Required for OpenGL support in X11 windowe= d backend of kwin_wayland" + PURPOSE "Required for building X11 windowed backend= of kwin_wayland" TYPE OPTIONAL) = ########### configure tests ############### diff --git a/backends/CMakeLists.txt b/backends/CMakeLists.txt index 809ac64..d3dc674 100644 --- a/backends/CMakeLists.txt +++ b/backends/CMakeLists.txt @@ -6,4 +6,6 @@ if(HAVE_LIBHYBRIS) add_subdirectory(hwcomposer) endif() add_subdirectory(wayland) -add_subdirectory(x11) +if(X11_XCB_FOUND) + add_subdirectory(x11) +endif() diff --git a/backends/x11/CMakeLists.txt b/backends/x11/CMakeLists.txt index 9ce72fa..9ac3607 100644 --- a/backends/x11/CMakeLists.txt +++ b/backends/x11/CMakeLists.txt @@ -6,10 +6,7 @@ set(X11BACKEND_SOURCES ) = add_library(KWinWaylandX11Backend MODULE ${X11BACKEND_SOURCES}) -target_link_libraries(KWinWaylandX11Backend kwin) -if(X11_XCB_FOUND) - target_link_libraries(KWinWaylandX11Backend X11::XCB) -endif() +target_link_libraries(KWinWaylandX11Backend kwin X11::XCB) = install( TARGETS diff --git a/backends/x11/x11windowed_backend.cpp b/backends/x11/x11windowe= d_backend.cpp index 95a5b70..74df134 100644 --- a/backends/x11/x11windowed_backend.cpp +++ b/backends/x11/x11windowed_backend.cpp @@ -23,9 +23,7 @@ along with this program. If not, see . #include "logging.h" #include "wayland_server.h" #include "xcbutils.h" -#if HAVE_X11_XCB #include "eglonxbackend.h" -#endif #include #include #include @@ -36,9 +34,7 @@ along with this program. If not, see . #include // system #include -#if HAVE_X11_XCB #include -#endif = namespace KWin { @@ -67,22 +63,16 @@ void X11WindowedBackend::init() { int screen =3D 0; xcb_connection_t *c =3D nullptr; -#if HAVE_X11_XCB Display *xDisplay =3D XOpenDisplay(deviceIdentifier().constData()); if (xDisplay) { c =3D XGetXCBConnection(xDisplay); XSetEventQueueOwner(xDisplay, XCBOwnsEventQueue); screen =3D XDefaultScreen(xDisplay); } -#else - c =3D xcb_connect(deviceIdentifier().constData(), &screen); -#endif if (c && !xcb_connection_has_error(c)) { m_connection =3D c; m_screenNumber =3D screen; -#if HAVE_X11_XCB m_display =3D xDisplay; -#endif for (xcb_screen_iterator_t it =3D xcb_setup_roots_iterator(xcb_get= _setup(m_connection)); it.rem; --screen, xcb_screen_next(&it)) { @@ -325,10 +315,7 @@ Screens *X11WindowedBackend::createScreens(QObject *pa= rent) = OpenGLBackend *X11WindowedBackend::createOpenGLBackend() { -#if HAVE_X11_XCB return new EglOnXBackend(connection(), display(), rootWindow(), scree= nNumer(), window()); -#endif - return nullptr; } = QPainterBackend *X11WindowedBackend::createQPainterBackend()