summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-07 10:18:50 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-07 10:24:33 +0200
commit5d6073be27cb951b692bbcc4dc0dd54cc09c9fd4 (patch)
treec87c236cd1b9c15eb5f40df3d86915687ab6c59a /src/plugins/platforms/xcb
parent97d7d80e7355019bb23bb03c2a82908e4436deb0 (diff)
parentbbb67ca32cebad312f02e916dff54e591b92af24 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: mkspecs/linux-icc/qmake.conf mkspecs/macx-icc/qmake.conf mkspecs/win32-icc/qmake.conf src/gui/painting/qgrayraster.c Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbmime.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp22
5 files changed, 19 insertions, 23 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index d9add22e00..bcd6e46fc6 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -693,7 +693,7 @@ void QGLXContext::queryDummyContext()
if (const char *renderer = (const char *) glGetString(GL_RENDERER)) {
for (int i = 0; qglx_threadedgl_blacklist_renderer[i]; ++i) {
if (strstr(renderer, qglx_threadedgl_blacklist_renderer[i]) != 0) {
- qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
+ qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
"blacklisted renderer \""
<< qglx_threadedgl_blacklist_renderer[i]
<< "\"";
@@ -706,7 +706,7 @@ void QGLXContext::queryDummyContext()
if (glxvendor) {
for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) {
if (strstr(glxvendor, qglx_threadedgl_blacklist_vendor[i]) != 0) {
- qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
+ qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
"blacklisted vendor \""
<< qglx_threadedgl_blacklist_vendor[i]
<< "\"";
@@ -722,7 +722,7 @@ void QGLXContext::queryDummyContext()
oldContext->makeCurrent(oldSurface);
if (!m_supportsThreading) {
- qCInfo(lcQpaGl) << "Force-enable multithreaded OpenGL by setting "
+ qCDebug(lcQpaGl) << "Force-enable multithreaded OpenGL by setting "
"environment variable QT_OPENGL_NO_SANITY_CHECK";
}
}
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index d7eeb5d118..c2e4edf2d5 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -1092,7 +1092,9 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
break;
case XCB_SELECTION_REQUEST:
{
+#if QT_CONFIG(draganddrop) || QT_CONFIG(clipboard)
xcb_selection_request_event_t *sr = reinterpret_cast<xcb_selection_request_event_t *>(event);
+#endif
#ifndef QT_NO_DRAGANDDROP
if (sr->selection == atom(QXcbAtom::XdndSelection))
m_drag->handleSelectionRequest(sr);
@@ -1285,9 +1287,9 @@ void QXcbEventReader::unlock()
m_mutex.unlock();
}
-void QXcbConnection::setFocusWindow(QXcbWindow *w)
+void QXcbConnection::setFocusWindow(QWindow *w)
{
- m_focusWindow = w;
+ m_focusWindow = w ? static_cast<QXcbWindow *>(w->handle()) : nullptr;
}
void QXcbConnection::setMouseGrabber(QXcbWindow *w)
{
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index cdd8e64676..512a1d09b9 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -480,7 +480,7 @@ public:
Qt::MouseButton translateMouseButton(xcb_button_t s);
QXcbWindow *focusWindow() const { return m_focusWindow; }
- void setFocusWindow(QXcbWindow *);
+ void setFocusWindow(QWindow *);
QXcbWindow *mouseGrabber() const { return m_mouseGrabber; }
void setMouseGrabber(QXcbWindow *);
QXcbWindow *mousePressWindow() const { return m_mousePressWindow; }
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index 186f31e08a..2848446098 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -44,12 +44,6 @@
#include <QtCore/QBuffer>
#include <qdebug.h>
-#include <X11/Xutil.h>
-
-#undef XCB_ATOM_STRING
-#undef XCB_ATOM_PIXMAP
-#undef XCB_ATOM_BITMAP
-
QT_BEGIN_NAMESPACE
#if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD))
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index db6ade5662..ff4408e3f1 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -284,6 +284,8 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s)
free_prop = false;
#if QT_CONFIG(textcodec)
}
+#else
+ Q_UNUSED(dpy);
#endif
return &tp;
}
@@ -916,7 +918,7 @@ void QXcbWindow::doFocusIn()
if (relayFocusToModalWindow())
return;
QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver();
- connection()->setFocusWindow(static_cast<QXcbWindow *>(w->handle()));
+ connection()->setFocusWindow(w);
QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason);
}
@@ -924,7 +926,7 @@ static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event
{
if (!event) {
// FocusIn event is not in the queue, proceed with FocusOut normally.
- QWindowSystemInterface::handleWindowActivated(0, Qt::ActiveWindowFocusReason);
+ QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
return true;
}
uint response_type = event->response_type & ~0x80;
@@ -949,12 +951,10 @@ static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event
void QXcbWindow::doFocusOut()
{
- if (relayFocusToModalWindow())
- return;
- connection()->setFocusWindow(0);
- // Do not set the active window to 0 if there is a FocusIn coming.
- // There is however no equivalent for XPutBackEvent so register a
- // callback for QXcbConnection instead.
+ connection()->setFocusWindow(nullptr);
+ relayFocusToModalWindow();
+ // Do not set the active window to nullptr if there is a FocusIn coming.
+ // The FocusIn handler will update QXcbConnection::setFocusWindow() accordingly.
connection()->addPeekFunc(focusInPeeker);
}
@@ -2746,14 +2746,14 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event)
reason = Qt::OtherFocusReason;
break;
}
- connection()->setFocusWindow(static_cast<QXcbWindow*>(window()->handle()));
+ connection()->setFocusWindow(window());
QWindowSystemInterface::handleWindowActivated(window(), reason);
break;
case XEMBED_FOCUS_OUT:
if (window() == QGuiApplication::focusWindow()
&& !activeWindowChangeQueued(window())) {
- connection()->setFocusWindow(0);
- QWindowSystemInterface::handleWindowActivated(0);
+ connection()->setFocusWindow(nullptr);
+ QWindowSystemInterface::handleWindowActivated(nullptr);
}
break;
}