summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorSergio Ahumada <sahumada@blackberry.com>2014-03-13 15:57:03 +0100
committerSergio Ahumada <sahumada@blackberry.com>2014-03-13 15:57:11 +0100
commit27016b89ae49da091527548af0ca9022ec4d7902 (patch)
treede408d49d52dd6a73e75a612ef51342d6ee44638 /src/plugins/platforms/xcb
parent3683bc97d2ebc0de3272fc09656b90a88f5eb326 (diff)
parentfbaa6d3ca6fc2693c5c8a1cd8e565803adc97730 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbmain.cpp (renamed from src/plugins/platforms/xcb/main.cpp)2
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp15
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h3
-rw-r--r--src/plugins/platforms/xcb/xcb-plugin.pro5
-rw-r--r--src/plugins/platforms/xcb/xcb-static/xcb-static.pro3
8 files changed, 24 insertions, 18 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp
index ed2f685770..eaa4d05311 100644
--- a/src/plugins/platforms/xcb/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/qglxintegration.cpp
@@ -537,7 +537,7 @@ QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface)
GLX_PBUFFER_HEIGHT, offscreenSurface->size().height(),
GLX_LARGEST_PBUFFER, False,
GLX_PRESERVED_CONTENTS, False,
- GLX_NONE
+ None
};
m_pbuffer = glXCreatePbuffer(DISPLAY_FROM_XCB(m_screen), config, attributes);
diff --git a/src/plugins/platforms/xcb/main.cpp b/src/plugins/platforms/xcb/qxcbmain.cpp
index f21ea03cf5..54c1629bf0 100644
--- a/src/plugins/platforms/xcb/main.cpp
+++ b/src/plugins/platforms/xcb/qxcbmain.cpp
@@ -62,4 +62,4 @@ QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const
QT_END_NAMESPACE
-#include "main.moc"
+#include "qxcbmain.moc"
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 7d69564c57..b45bd6a82e 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -80,7 +80,8 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"),
QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"),
QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"),
- QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen")
+ QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen"),
+ QByteArrayLiteral("rootwindow")
};
const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
const QByteArray *result = std::find(names, end, key);
@@ -142,6 +143,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour
case X11Screen:
result = x11Screen();
break;
+ case RootWindow:
+ result = rootWindow();
+ break;
default:
break;
}
@@ -264,6 +268,15 @@ void *QXcbNativeInterface::x11Screen()
return 0;
}
+void *QXcbNativeInterface::rootWindow()
+{
+ QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ QXcbConnection *defaultConnection = integration->defaultConnection();
+ if (defaultConnection)
+ return reinterpret_cast<void *>(defaultConnection->rootWindow());
+ return 0;
+}
+
void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)
{
static_cast<QXcbScreen *>(screen->handle())->connection()->setTime(time);
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 9c4fa44d3b..fb1a46014c 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -70,7 +70,8 @@ public:
StartupId,
TrayWindow,
GetTimestamp,
- X11Screen
+ X11Screen,
+ RootWindow
};
QXcbNativeInterface();
@@ -94,6 +95,7 @@ public:
void *getTimestamp(const QXcbScreen *screen);
void *startupId();
void *x11Screen();
+ void *rootWindow();
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
static void *eglContextForContext(QOpenGLContext *context);
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 29f71e6972..aabcb84a08 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -64,9 +64,7 @@
#include <xcb/xcb_icccm.h>
#undef class
#include <xcb/xfixes.h>
-#ifndef QT_NO_SHAPE
-# include <xcb/shape.h>
-#endif // QT_NO_SHAPE
+#include <xcb/shape.h>
// xcb-icccm 3.8 support
#ifdef XCB_ICCCM_NUM_WM_SIZE_HINTS_ELEMENTS
@@ -2077,8 +2075,6 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event)
}
}
-#if !defined(QT_NO_SHAPE)
-
static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r)
{
xcb_rectangle_t result;
@@ -2123,8 +2119,6 @@ void QXcbWindow::setMask(const QRegion &region)
}
}
-#endif // !QT_NO_SHAPE
-
void QXcbWindow::setAlertState(bool enabled)
{
if (m_alertState == enabled)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 45d44b213f..a90ad7b5ed 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -114,10 +114,7 @@ public:
bool startSystemResize(const QPoint &pos, Qt::Corner corner);
void setOpacity(qreal level);
-
-#if !defined(QT_NO_SHAPE)
void setMask(const QRegion &region);
-#endif // !QT_NO_SHAPE
void setAlertState(bool enabled);
bool isAlertState() const { return m_alertState; }
diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro
index 4727262f3f..bfbec91e3c 100644
--- a/src/plugins/platforms/xcb/xcb-plugin.pro
+++ b/src/plugins/platforms/xcb/xcb-plugin.pro
@@ -17,7 +17,7 @@ SOURCES = \
qxcbwindow.cpp \
qxcbbackingstore.cpp \
qxcbwmsupport.cpp \
- main.cpp \
+ qxcbmain.cpp \
qxcbnativeinterface.cpp \
qxcbcursor.cpp \
qxcbimage.cpp \
@@ -121,8 +121,7 @@ contains(QT_CONFIG, xcb-qt) {
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static
} else {
- LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr
- !contains(DEFINES, QT_NO_SHAPE):LIBS += -lxcb-shape
+ LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape
contains(DEFINES, QT_NO_XKB) {
LIBS += -lxcb-keysyms
} else {
diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
index 2fd5519053..19852b74b1 100644
--- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
+++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
@@ -1,6 +1,7 @@
#
# Statically compile in code for
-# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image, libxcb-keysyms, libxcb-icccm, libxcb-renderutil
+# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image,
+# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb
#
TEMPLATE = lib
TARGET = xcb-static