[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kwin] /: Make X11_XCB a build dependency of X11 windowed backend
From: Martin_Gräßlin <mgraesslin () kde ! org>
Date: 2015-08-12 9:39:42
Message-ID: E1ZPSVa-0005Uk-Qj () scm ! kde ! org
[Download RAW message or body]
Git commit 5d946e37629b56be5b57931c1a3f0463dc8bd913 by Martin Gräßlin.
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 windowed 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/x11windowed_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 <http://www.gnu.org/licenses/>.
#include "logging.h"
#include "wayland_server.h"
#include "xcbutils.h"
-#if HAVE_X11_XCB
#include "eglonxbackend.h"
-#endif
#include <kwinxrenderutils.h>
#include <QAbstractEventDispatcher>
#include <QCoreApplication>
@@ -36,9 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Server/surface_interface.h>
// system
#include <linux/input.h>
-#if HAVE_X11_XCB
#include <X11/Xlib-xcb.h>
-#endif
namespace KWin
{
@@ -67,22 +63,16 @@ void X11WindowedBackend::init()
{
int screen = 0;
xcb_connection_t *c = nullptr;
-#if HAVE_X11_XCB
Display *xDisplay = XOpenDisplay(deviceIdentifier().constData());
if (xDisplay) {
c = XGetXCBConnection(xDisplay);
XSetEventQueueOwner(xDisplay, XCBOwnsEventQueue);
screen = XDefaultScreen(xDisplay);
}
-#else
- c = xcb_connect(deviceIdentifier().constData(), &screen);
-#endif
if (c && !xcb_connection_has_error(c)) {
m_connection = c;
m_screenNumber = screen;
-#if HAVE_X11_XCB
m_display = xDisplay;
-#endif
for (xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(m_connection));
it.rem;
--screen, xcb_screen_next(&it)) {
@@ -325,10 +315,7 @@ Screens *X11WindowedBackend::createScreens(QObject *parent)
OpenGLBackend *X11WindowedBackend::createOpenGLBackend()
{
-#if HAVE_X11_XCB
return new EglOnXBackend(connection(), display(), rootWindow(), screenNumer(), window());
-#endif
- return nullptr;
}
QPainterBackend *X11WindowedBackend::createQPainterBackend()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic