diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-09-22 14:17:52 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-09-23 11:23:36 +0200 |
commit | c5a3e5edd9e63b18abf1838c86a27a662224b02c (patch) | |
tree | 9a367c113d9b586da73439cb100744d616ce6399 /src/plugins/platforms | |
parent | 3312ac91692c3a4a033d123eecbf982d3ff10471 (diff) | |
parent | a5df2e7120412dfdedb9f4951cdb061c0f218bf7 (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4
The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38
so manually removed code in
src/plugins/bearer/connman/qconnmanengine.cpp
Conflicts:
src/corelib/global/qglobal.h
src/corelib/tools/qcollator_macx.cpp
src/corelib/tools/qstring.cpp
src/gui/kernel/qwindow.cpp
src/gui/kernel/qwindow_p.h
src/gui/text/qtextengine.cpp
src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
src/plugins/platforms/android/qandroidinputcontext.cpp
src/plugins/platforms/xcb/qglxintegration.cpp
src/plugins/platforms/xcb/qglxintegration.h
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/testlib/qtestcase.cpp
src/testlib/qtestlog.cpp
src/widgets/dialogs/qfiledialog.cpp
src/widgets/kernel/qwindowcontainer.cpp
tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
Diffstat (limited to 'src/plugins/platforms')
25 files changed, 183 insertions, 149 deletions
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index defc59abf0..2c4b664487 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -47,6 +47,7 @@ #include <QTouchEvent> #include <QPointer> +#include <QGuiApplication> #include <QDebug> QT_BEGIN_NAMESPACE @@ -58,10 +59,10 @@ namespace QtAndroidInput static jmethodID m_showSoftwareKeyboardMethodID = 0; static jmethodID m_resetSoftwareKeyboardMethodID = 0; static jmethodID m_hideSoftwareKeyboardMethodID = 0; - static jmethodID m_isSoftwareKeyboardVisibleMethodID = 0; static jmethodID m_updateSelectionMethodID = 0; static bool m_ignoreMouseEvents = false; + static bool m_softwareKeyboardVisible = false; static QList<QWindowSystemInterface::TouchPoint> m_touchPoints; @@ -124,15 +125,7 @@ namespace QtAndroidInput bool isSoftwareKeyboardVisible() { - AttachedJNIEnv env; - if (!env.jniEnv) - return false; - - bool visibility = env.jniEnv->CallStaticBooleanMethod(applicationClass(), m_isSoftwareKeyboardVisibleMethodID); -#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL - qDebug() << "@@@ ISSOFTWAREKEYBOARDVISIBLE" << visibility; -#endif - return visibility; + return m_softwareKeyboardVisible; } @@ -713,10 +706,11 @@ namespace QtAndroidInput false); } - static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean /*visibility*/) + static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean visibility) { + m_softwareKeyboardVisible = visibility; QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext(); - if (inputContext) + if (inputContext && qGuiApp) inputContext->emitInputPanelVisibleChanged(); #ifdef QT_DEBUG_ANDROID_IM_PROTOCOL qDebug() << "@@@ KEYBOARDVISIBILITYCHANGED" << inputContext; @@ -755,7 +749,6 @@ namespace QtAndroidInput GET_AND_CHECK_STATIC_METHOD(m_showSoftwareKeyboardMethodID, appClass, "showSoftwareKeyboard", "(IIIII)V"); GET_AND_CHECK_STATIC_METHOD(m_resetSoftwareKeyboardMethodID, appClass, "resetSoftwareKeyboard", "()V"); GET_AND_CHECK_STATIC_METHOD(m_hideSoftwareKeyboardMethodID, appClass, "hideSoftwareKeyboard", "()V"); - GET_AND_CHECK_STATIC_METHOD(m_isSoftwareKeyboardVisibleMethodID, appClass, "isSoftwareKeyboardVisible", "()Z"); GET_AND_CHECK_STATIC_METHOD(m_updateSelectionMethodID, appClass, "updateSelection", "(IIII)V"); return true; } diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 7b76177141..6df9f56c2c 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -559,6 +559,12 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, jint desktopWidthPixels, jint desktopHeightPixels, jdouble xdpi, jdouble ydpi, jdouble scaledDensity) { + // Android does not give us the correct screen size for immersive mode, but + // the surface does have the right size + + widthPixels = qMax(widthPixels, desktopWidthPixels); + heightPixels = qMax(heightPixels, desktopHeightPixels); + m_desktopWidthPixels = desktopWidthPixels; m_desktopHeightPixels = desktopHeightPixels; m_scaledDensity = scaledDensity; @@ -573,8 +579,8 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, } else { m_androidPlatformIntegration->setDisplayMetrics(qRound(double(widthPixels) / xdpi * 25.4), qRound(double(heightPixels) / ydpi * 25.4)); - m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels); m_androidPlatformIntegration->setScreenSize(widthPixels, heightPixels); + m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels); } } diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 53cb3588f6..cbf13e81d5 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -121,8 +121,8 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_primaryScreen = new QAndroidPlatformScreen(); screenAdded(m_primaryScreen); m_primaryScreen->setPhysicalSize(QSize(m_defaultPhysicalSizeWidth, m_defaultPhysicalSizeHeight)); - m_primaryScreen->setAvailableGeometry(QRect(0, 0, m_defaultGeometryWidth, m_defaultGeometryHeight)); m_primaryScreen->setSize(QSize(m_defaultScreenWidth, m_defaultScreenHeight)); + m_primaryScreen->setAvailableGeometry(QRect(0, 0, m_defaultGeometryWidth, m_defaultGeometryHeight)); m_mainThread = QThread::currentThread(); QtAndroid::setAndroidPlatformIntegration(this); diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp index 2c6e8370ce..e8dc8a9c5c 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp @@ -64,17 +64,28 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface) QEGLPlatformContext::swapBuffers(surface); } -bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaroud() +bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround() { static bool set = false; static bool needsWorkaround = false; if (!set) { - const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); - needsWorkaround = - qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 - || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 - || qstrcmp(rendererString, "GC1000 core") == 0; + QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND"); + needsWorkaround = env.isEmpty() || env == "0" || env == "false"; + + if (!needsWorkaround) { + const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); + needsWorkaround = + qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 + || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 + || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)' + || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305 + || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)' + || qstrcmp(rendererString, "GC800 core") == 0 + || qstrcmp(rendererString, "GC1000 core") == 0 + || qstrcmp(rendererString, "Immersion.16") == 0; + } + set = true; } @@ -90,7 +101,7 @@ bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface) if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) ctx_d->workaround_missingPrecisionQualifiers = true; - if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaroud()) + if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) ctx_d->workaround_brokenFBOReadBack = true; return ret; diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h index 10a89d541b..b734cb4db9 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.h +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.h @@ -57,7 +57,7 @@ public: private: virtual EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface); - static bool needsFBOReadBackWorkaroud(); + static bool needsFBOReadBackWorkaround(); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/messages.cpp b/src/plugins/platforms/cocoa/messages.cpp index 8fc8b312f5..4f7b038c6f 100644 --- a/src/plugins/platforms/cocoa/messages.cpp +++ b/src/plugins/platforms/cocoa/messages.cpp @@ -76,27 +76,29 @@ QString qt_mac_applicationmenu_string(int type) QPlatformMenuItem::MenuRole detectMenuRole(const QString &caption) { + QString captionNoAmpersand(caption); + captionNoAmpersand.remove(QChar('&')); const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About"); - if (caption.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive)) + if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive)) return QPlatformMenuItem::AboutRole; - if (caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive) - || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive) - || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive) - || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive) - || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) { + if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive) + || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive) + || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive) + || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive) + || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) { return QPlatformMenuItem::PreferencesRole; } - if (caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive) - || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) { + if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive) + || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) { return QPlatformMenuItem::QuitRole; } - if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Cut"), Qt::CaseInsensitive)) + if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Cut"), Qt::CaseInsensitive)) return QPlatformMenuItem::CutRole; - if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Copy"), Qt::CaseInsensitive)) + if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Copy"), Qt::CaseInsensitive)) return QPlatformMenuItem::CopyRole; - if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Paste"), Qt::CaseInsensitive)) + if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Paste"), Qt::CaseInsensitive)) return QPlatformMenuItem::PasteRole; - if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Select All"), Qt::CaseInsensitive)) + if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Select All"), Qt::CaseInsensitive)) return QPlatformMenuItem::SelectAllRole; return QPlatformMenuItem::NoRole; } diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm index 551a59823c..bac76357da 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplication.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm @@ -189,6 +189,12 @@ QT_BEGIN_NAMESPACE void qt_redirectNSApplicationSendEvent() { + if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) + // In a plugin we cannot chain sendEvent hooks: a second plugin could + // store the implementation of the first, which during the program flow + // can be unloaded. + return; + if ([NSApp isMemberOfClass:[QNSApplication class]]) { // No need to change implementation since Qt // already controls a subclass of NSApplication @@ -209,6 +215,10 @@ void qt_redirectNSApplicationSendEvent() void qt_resetNSApplicationSendEvent() { + if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) + return; + + qt_cocoa_change_back_implementation([NSApplication class], @selector(sendEvent:), @selector(QT_MANGLE_NAMESPACE(qt_sendEvent_original):)); diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index efe3269d42..326628a261 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -163,6 +163,9 @@ static void cleanupCocoaApplicationDelegate() - (NSMenu *)applicationDockMenu:(NSApplication *)sender { Q_UNUSED(sender); + // Manually invoke the delegate's -menuWillOpen: method. + // See QTBUG-39604 (and its fix) for details. + [[dockMenu delegate] menuWillOpen:dockMenu]; return [[dockMenu retain] autorelease]; } diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index ebe58be155..e0838cb342 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -369,11 +369,15 @@ void QCocoaIntegration::updateScreens() return; QSet<QCocoaScreen*> remainingScreens = QSet<QCocoaScreen*>::fromList(mScreens); QList<QPlatformScreen *> siblings; - for (uint i = 0; i < [screens count]; i++) { + uint screenCount = [screens count]; + for (uint i = 0; i < screenCount; i++) { NSScreen* scr = [screens objectAtIndex:i]; CGDirectDisplayID dpy = [[[scr deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue]; // If this screen is a mirror and is not the primary one of the mirror set, ignore it. - if (CGDisplayIsInMirrorSet(dpy)) { + // Exception: The NSScreen API has been observed to a return a screen list with one + // mirrored, non-primary screen when Qt is running as a startup item. Always use the + // screen if there's only one screen in the list. + if (screenCount > 1 && CGDisplayIsInMirrorSet(dpy)) { CGDirectDisplayID primary = CGDisplayMirrorsDisplay(dpy); if (primary != kCGNullDirectDisplay && primary != dpy) continue; diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index a89979a8ea..3d0201e1a0 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -463,9 +463,8 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf // Else, we need to transform 'pos' to window or screen coordinates. NSPoint nsPos = NSMakePoint(pos.x() - 1, pos.y()); if (view) { - // Flip y-coordinate first, the convert to content view space. - nsPos.y = view.frame.size.height - nsPos.y; - nsPos = [view convertPoint:nsPos toView:view.window.contentView]; + // convert coordinates from view to the view's window + nsPos = [view convertPoint:nsPos toView:nil]; } else if (!QGuiApplication::screens().isEmpty()) { QScreen *screen = QGuiApplication::screens().at(0); nsPos.y = screen->availableVirtualSize().height() - nsPos.y; diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index a75e366a73..dc38bcb83d 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -48,6 +48,8 @@ #include <QtGui/QImage> #include <QtGui/QAccessible> +#include "private/qcore_mac_p.h" + QT_BEGIN_NAMESPACE class QCocoaWindow; class QCocoaBackingStore; @@ -56,7 +58,7 @@ QT_END_NAMESPACE Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper); -@interface QNSView : NSView <NSTextInputClient> { +@interface QT_MANGLE_NAMESPACE(QNSView) : NSView <NSTextInputClient> { QCocoaBackingStore* m_backingStore; QPoint m_backingStoreOffset; CGImageRef m_maskImage; @@ -78,6 +80,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper); #endif NSString *m_inputSource; QNSViewMouseMoveHelper *m_mouseMoveHelper; + bool m_resendKeyEvent; } - (id)init; @@ -138,4 +141,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper); @end +QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView); + #endif //QNSVIEW_H diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index cfcbb8053c..d72664f0a0 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -130,7 +130,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil; @end -@implementation QNSView +@implementation QT_MANGLE_NAMESPACE(QNSView) + (void)initialize { @@ -159,6 +159,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil; m_sendUpAsRightButton = false; m_inputSource = 0; m_mouseMoveHelper = [[QNSViewMouseMoveHelper alloc] initWithView:self]; + m_resendKeyEvent = false; if (!touchDevice) { touchDevice = new QTouchDevice; @@ -1425,6 +1426,8 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) } } } + if (m_resendKeyEvent) + m_sendKeyEvent = true; } if (m_sendKeyEvent && m_composingText.isEmpty()) @@ -1432,6 +1435,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat]); m_sendKeyEvent = false; + m_resendKeyEvent = false; } - (void)keyDown:(NSEvent *)nsevent @@ -1502,6 +1506,12 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) } } +- (void) insertNewline:(id)sender +{ + Q_UNUSED(sender); + m_resendKeyEvent = true; +} + - (void) doCommandBySelector:(SEL)aSelector { [self tryToPerform:aSelector with:self]; diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 7ae042cb50..c986a960f3 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window) : QPlatformBackingStore(window), - m_hasUnflushedPaintOperations(false) + m_needsPosting(false), + m_scrolled(false) { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window; @@ -85,10 +86,10 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window(); // Sometimes this method is called even though there is nothing to be - // flushed, for instance, after an expose event directly follows a - // geometry change event. - if (!m_hasUnflushedPaintOperations) - return; + // flushed (posted in "screen" parlance), for instance, after an expose + // event directly follows a geometry change event. + if (!m_needsPosting) + return; QQnxWindow *targetWindow = 0; if (window) @@ -99,25 +100,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const // child windows, are performed; conceptually ,child windows have no buffers // (actually they do have a 1x1 placeholder buffer due to libscreen limitations), // since Qt will only draw to the backing store of the top-level window. - if (!targetWindow || targetWindow == platformWindow()) { + if (!targetWindow || targetWindow == platformWindow()) + platformWindow()->post(region); // update the display with newly rendered content - // visit all pending scroll operations - for (int i = m_scrollOpList.size() - 1; i >= 0; i--) { - - // do the scroll operation - ScrollOp &op = m_scrollOpList[i]; - QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) ); - platformWindow()->scroll(srcArea, op.dx, op.dy); - } - - // clear all pending scroll operations - m_scrollOpList.clear(); - - // update the display with newly rendered content - platformWindow()->post(region); - } - - m_hasUnflushedPaintOperations = false; + m_needsPosting = false; + m_scrolled = false; } void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticContents) @@ -134,31 +121,14 @@ bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy) { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); - // calculate entire region affected by scroll operation (src + dst) - QRegion totalArea = area.translated(dx, dy); - totalArea += area; - m_hasUnflushedPaintOperations = true; - - // visit all pending scroll operations - for (int i = m_scrollOpList.size() - 1; i >= 0; i--) { - - ScrollOp &op = m_scrollOpList[i]; - if (op.totalArea == totalArea) { - // same area is being scrolled again - update delta - op.dx += dx; - op.dy += dy; - return true; - } else if (op.totalArea.intersects(totalArea)) { - // current scroll overlaps previous scroll but is - // not equal in area - just paint everything - qWarning("QQNX: pending scroll operations overlap but not equal"); - return false; - } - } + m_needsPosting = true; - // create new scroll operation - m_scrollOpList.append( ScrollOp(totalArea, dx, dy) ); - return true; + if (!m_scrolled) { + platformWindow()->scroll(area, dx, dy, true); + m_scrolled = true; + return true; + } + return false; } void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) @@ -166,7 +136,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) Q_UNUSED(region); qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); - m_hasUnflushedPaintOperations = true; + m_needsPosting = true; platformWindow()->adjustBufferSize(); diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h index 35efd68571..d71e274a1d 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h @@ -64,19 +64,11 @@ public: void endPaint(); private: - class ScrollOp { - public: - ScrollOp(const QRegion &a, int x, int y) : totalArea(a), dx(x), dy(y) {} - QRegion totalArea; - int dx; - int dy; - }; - QQnxRasterWindow *platformWindow() const; QWindow *m_window; - QList<ScrollOp> m_scrollOpList; - bool m_hasUnflushedPaintOperations; + bool m_needsPosting; + bool m_scrolled; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp index 08de94a082..232bd80fd0 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp @@ -46,7 +46,7 @@ #include <bps/event.h> #include <bps/locale.h> #include <bps/virtualkeyboard.h> -#if defined(Q_OS_BLACKBERRY) +#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) #include <bbndk.h> #endif @@ -126,17 +126,21 @@ virtualkeyboard_layout_t QQnxVirtualKeyboardBps::keyboardLayout() const return VIRTUALKEYBOARD_LAYOUT_WEB; case NumPunc: return VIRTUALKEYBOARD_LAYOUT_NUM_PUNC; +#ifndef Q_OS_BLACKBERRY_TABLET case Number: return VIRTUALKEYBOARD_LAYOUT_NUMBER; +#endif case Symbol: return VIRTUALKEYBOARD_LAYOUT_SYMBOL; case Phone: return VIRTUALKEYBOARD_LAYOUT_PHONE; case Pin: return VIRTUALKEYBOARD_LAYOUT_PIN; +#ifndef Q_OS_BLACKBERRY_TABLET case Password: return VIRTUALKEYBOARD_LAYOUT_PASSWORD; -#if defined(Q_OS_BLACKBERRY) +#endif +#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) #if BBNDK_VERSION_AT_LEAST(10, 2, 1) case Alphanumeric: return VIRTUALKEYBOARD_LAYOUT_ALPHANUMERIC; diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index b22c35137d..7dbca6c089 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1583,11 +1583,11 @@ QStringList QWindowsFontDatabase::extraTryFontsForFamily(const QString &family) if (!tryFonts) { LANGID lid = GetUserDefaultLangID(); switch (lid&0xff) { - case LANG_CHINESE: // Chinese (Taiwan) - if ( lid == 0x0804 ) // Taiwan - tryFonts = ch_TW_tryFonts; - else + case LANG_CHINESE: // Chinese + if ( lid == 0x0804 || lid == 0x1004) // China mainland and Singapore tryFonts = ch_CN_tryFonts; + else + tryFonts = ch_TW_tryFonts; // Taiwan, Hong Kong and Macau break; case LANG_JAPANESE: tryFonts = jp_tryFonts; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index f6b1eefc13..06b566629b 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1971,7 +1971,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const mmi->ptMaxPosition.x = screen->availableGeometry().x(); mmi->ptMaxPosition.y = screen->availableGeometry().y(); } else if (!screen){ - qWarning() << "effectiveScreen() returned a null screen"; + qWarning() << "window()->screen() returned a null screen"; } } diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 3b13df863e..bcb35f6cf0 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -165,7 +165,7 @@ static void updateFormatFromContext(QSurfaceFormat &format) QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle) : QPlatformOpenGLContext() - , m_screen(screen) + , m_display(DISPLAY_FROM_XCB(screen)) , m_config(0) , m_context(0) , m_shareContext(0) @@ -200,7 +200,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0; glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB"); - QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber())).split(' '); + QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(m_display, screen->screenNumber())).split(' '); bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile"); // Use glXCreateContextAttribsARB if available @@ -269,10 +269,10 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) contextAttributes << None; - m_context = glXCreateContextAttribsARB(DISPLAY_FROM_XCB(screen), config, m_shareContext, true, contextAttributes.data()); + m_context = glXCreateContextAttribsARB(m_display, config, m_shareContext, true, contextAttributes.data()); if (!m_context && m_shareContext) { // re-try without a shared glx context - m_context = glXCreateContextAttribsARB(DISPLAY_FROM_XCB(screen), config, 0, true, contextAttributes.data()); + m_context = glXCreateContextAttribsARB(m_display, config, 0, true, contextAttributes.data()); if (m_context) m_shareContext = 0; } @@ -285,10 +285,10 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) if (m_format.renderableType() == QSurfaceFormat::OpenGLES) return; - m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, m_shareContext, true); + m_context = glXCreateNewContext(m_display, config, GLX_RGBA_TYPE, m_shareContext, true); if (!m_context && m_shareContext) { // re-try without a shared glx context - m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, 0, true); + m_context = glXCreateNewContext(m_display, config, GLX_RGBA_TYPE, 0, true); if (m_context) m_shareContext = 0; } @@ -306,14 +306,14 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) return; // Note that m_format gets updated with the used surface format - visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(screen), screen->screenNumber(), &m_format); + visualInfo = qglx_findVisualInfo(m_display, screen->screenNumber(), &m_format); if (!visualInfo) qFatal("Could not initialize GLX"); - m_context = glXCreateContext(DISPLAY_FROM_XCB(screen), visualInfo, m_shareContext, true); + m_context = glXCreateContext(m_display, visualInfo, m_shareContext, true); if (!m_context && m_shareContext) { // re-try without a shared glx context m_shareContext = 0; - m_context = glXCreateContext(DISPLAY_FROM_XCB(screen), visualInfo, 0, true); + m_context = glXCreateContext(m_display, visualInfo, Q_NULLPTR, true); } // Create a temporary window so that we can make the new context current @@ -325,13 +325,15 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) if (m_context && window) { GLXContext prevContext = glXGetCurrentContext(); GLXDrawable prevDrawable = glXGetCurrentDrawable(); - glXMakeCurrent(DISPLAY_FROM_XCB(screen), window, m_context); + glXMakeCurrent(m_display, window, m_context); updateFormatFromContext(m_format); - glXMakeCurrent(DISPLAY_FROM_XCB(screen), prevDrawable, prevContext); + + // Make our context non-current + glXMakeCurrent(m_display, prevDrawable, prevContext); } // Destroy our temporary window - XDestroyWindow(DISPLAY_FROM_XCB(screen), window); + XDestroyWindow(m_display, window); } void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle) @@ -449,7 +451,18 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QGLXContext::~QGLXContext() { if (m_ownsContext) - glXDestroyContext(DISPLAY_FROM_XCB(m_screen), m_context); + glXDestroyContext(m_display, m_context); +} + +static QXcbScreen *screenForPlatformSurface(QPlatformSurface *surface) +{ + QSurface::SurfaceClass surfaceClass = surface->surface()->surfaceClass(); + if (surfaceClass == QSurface::Window) { + return static_cast<QXcbScreen *>(static_cast<QXcbWindow *>(surface)->screen()); + } else if (surfaceClass == QSurface::Offscreen) { + return static_cast<QXcbScreen *>(static_cast<QGLXPbuffer *>(surface)->screen()); + } + return Q_NULLPTR; } QVariant QGLXContext::nativeHandle() const @@ -462,24 +475,24 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface) bool success = false; Q_ASSERT(surface->surface()->supportsOpenGL()); - Display *dpy = DISPLAY_FROM_XCB(m_screen); GLXDrawable glxDrawable = 0; QSurface::SurfaceClass surfaceClass = surface->surface()->surfaceClass(); if (surfaceClass == QSurface::Window) { m_isPBufferCurrent = false; QXcbWindow *window = static_cast<QXcbWindow *>(surface); glxDrawable = window->xcb_window(); - success = glXMakeCurrent(dpy, glxDrawable, m_context); + success = glXMakeCurrent(m_display, glxDrawable, m_context); } else if (surfaceClass == QSurface::Offscreen) { m_isPBufferCurrent = true; QGLXPbuffer *pbuffer = static_cast<QGLXPbuffer *>(surface); glxDrawable = pbuffer->pbuffer(); - success = glXMakeContextCurrent(dpy, glxDrawable, glxDrawable, m_context); + success = glXMakeContextCurrent(m_display, glxDrawable, glxDrawable, m_context); } if (success) { int interval = surface->format().swapInterval(); - if (interval >= 0 && m_swapInterval != interval) { + QXcbScreen *screen = screenForPlatformSurface(surface); + if (interval >= 0 && m_swapInterval != interval && screen) { m_swapInterval = interval; typedef void (*qt_glXSwapIntervalEXT)(Display *, GLXDrawable, int); typedef void (*qt_glXSwapIntervalMESA)(unsigned int); @@ -488,15 +501,15 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface) static bool resolved = false; if (!resolved) { resolved = true; - QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(dpy, - m_screen->screenNumber())).split(' '); + QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(m_display, + screen->screenNumber())).split(' '); if (glxExt.contains("GLX_EXT_swap_control")) glXSwapIntervalEXT = (qt_glXSwapIntervalEXT) getProcAddress("glXSwapIntervalEXT"); if (glxExt.contains("GLX_MESA_swap_control")) glXSwapIntervalMESA = (qt_glXSwapIntervalMESA) getProcAddress("glXSwapIntervalMESA"); } if (glXSwapIntervalEXT) - glXSwapIntervalEXT(dpy, glxDrawable, interval); + glXSwapIntervalEXT(m_display, glxDrawable, interval); else if (glXSwapIntervalMESA) glXSwapIntervalMESA(interval); } @@ -508,9 +521,9 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface) void QGLXContext::doneCurrent() { if (m_isPBufferCurrent) - glXMakeContextCurrent(DISPLAY_FROM_XCB(m_screen), 0, 0, 0); + glXMakeContextCurrent(m_display, 0, 0, 0); else - glXMakeCurrent(DISPLAY_FROM_XCB(m_screen), 0, 0); + glXMakeCurrent(m_display, 0, 0); m_isPBufferCurrent = false; } @@ -521,7 +534,7 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface) glxDrawable = static_cast<QGLXPbuffer *>(surface)->pbuffer(); else glxDrawable = static_cast<QXcbWindow *>(surface)->xcb_window(); - glXSwapBuffers(DISPLAY_FROM_XCB(m_screen), glxDrawable); + glXSwapBuffers(m_display, glxDrawable); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast<QXcbWindow *>(surface); @@ -542,7 +555,7 @@ void (*QGLXContext::getProcAddress(const QByteArray &procName)) () if (resolved && !glXGetProcAddressARB) return 0; if (!glXGetProcAddressARB) { - QList<QByteArray> glxExt = QByteArray(glXGetClientString(DISPLAY_FROM_XCB(m_screen), GLX_EXTENSIONS)).split(' '); + QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' '); if (glxExt.contains("GLX_ARB_get_proc_address")) { #if defined(Q_OS_LINUX) || defined(Q_OS_BSD4) void *handle = dlopen(NULL, RTLD_LAZY); diff --git a/src/plugins/platforms/xcb/qglxintegration.h b/src/plugins/platforms/xcb/qglxintegration.h index abe3216ad7..2acf262bd0 100644 --- a/src/plugins/platforms/xcb/qglxintegration.h +++ b/src/plugins/platforms/xcb/qglxintegration.h @@ -84,6 +84,7 @@ private: void init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle); QXcbScreen *m_screen; + Display *m_display; GLXFBConfig m_config; GLXContext m_context; GLXContext m_shareContext; diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index ed5fe6d7c0..636914fd07 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -414,6 +414,9 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra qunsetenv("DESKTOP_STARTUP_ID"); sync(); + + if (qEnvironmentVariableIsEmpty("QT_IM_MODULE")) + qputenv("QT_IM_MODULE", QByteArray("compose")); } QXcbConnection::~QXcbConnection() @@ -494,7 +497,7 @@ break; if (QXcbWindowEventListener *eventListener = windowEventListenerFromId(e->event)) { \ handled = eventListener->handleGenericEvent(event, &result); \ if (!handled) \ - m_keyboard->handler(m_focusWindow ? m_focusWindow : eventListener, e); \ + m_keyboard->handler(e); \ } \ } \ break; diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 60a36a8da1..bd62b07a09 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -164,7 +164,10 @@ void QXcbConnection::xi2SetupDevices() if (bci->num_buttons >= 5) { Atom label4 = bci->labels[3]; Atom label5 = bci->labels[4]; - if ((!label4 || qatom(label4) == QXcbAtom::ButtonWheelUp) && (!label5 || qatom(label5) == QXcbAtom::ButtonWheelDown)) + // Some drivers have no labels on the wheel buttons, some have no label on just one and some have no label on + // button 4 and the wrong one on button 5. So we just check that they are not labelled with unrelated buttons. + if ((!label4 || qatom(label4) == QXcbAtom::ButtonWheelUp || qatom(label4) == QXcbAtom::ButtonWheelDown) && + (!label5 || qatom(label5) == QXcbAtom::ButtonWheelUp || qatom(label5) == QXcbAtom::ButtonWheelDown)) scrollingDevice.legacyOrientations |= Qt::Vertical; } if (bci->num_buttons >= 7) { diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index c52714b456..dd2a9fcaed 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -1299,7 +1299,7 @@ private: bool m_release; }; -void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycode_t code, +void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time) { Q_XCB_NOOP(connection()); @@ -1307,6 +1307,13 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod if (!m_config) return; + QXcbWindow *source = connection()->platformWindowFromId(sourceWindow); + QXcbWindow *targetWindow = connection()->focusWindow() ? connection()->focusWindow() : source; + if (!targetWindow || !source) + return; + if (type == QEvent::KeyPress) + targetWindow->updateNetWmUserTime(time); + // It is crucial the order of xkb_state_key_get_one_sym & xkb_state_update_key operations is not reversed! xcb_keysym_t sym = xkb_state_key_get_one_sym(xkb_state, code); @@ -1347,7 +1354,7 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod } } else { // look ahead for auto-repeat - KeyChecker checker(((QXcbWindow *)window->handle())->xcb_window(), code, time); + KeyChecker checker(source->xcb_window(), code, time); xcb_generic_event_t *event = connection()->checkEvent(checker); if (event) { isAutoRepeat = true; @@ -1363,6 +1370,7 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod filtered = inputContext->filterEvent(&event); } + QWindow *window = targetWindow->window(); if (!filtered) { if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu) { const QPoint globalPos = window->screen()->handle()->cursor()->pos(); @@ -1405,21 +1413,14 @@ QString QXcbKeyboard::lookupString(struct xkb_state *state, xcb_keycode_t code) return QString::fromUtf8(chars); } -void QXcbKeyboard::handleKeyPressEvent(QXcbWindowEventListener *eventListener, const xcb_key_press_event_t *event) +void QXcbKeyboard::handleKeyPressEvent(const xcb_key_press_event_t *event) { - QXcbWindow *window = eventListener->toWindow(); - if (!window) - return; - window->updateNetWmUserTime(event->time); - handleKeyEvent(window->window(), QEvent::KeyPress, event->detail, event->state, event->time); + handleKeyEvent(event->event, QEvent::KeyPress, event->detail, event->state, event->time); } -void QXcbKeyboard::handleKeyReleaseEvent(QXcbWindowEventListener *eventListener, const xcb_key_release_event_t *event) +void QXcbKeyboard::handleKeyReleaseEvent(const xcb_key_release_event_t *event) { - QXcbWindow *window = eventListener->toWindow(); - if (!window) - return; - handleKeyEvent(window->window(), QEvent::KeyRelease, event->detail, event->state, event->time); + handleKeyEvent(event->event, QEvent::KeyRelease, event->detail, event->state, event->time); } void QXcbKeyboard::handleMappingNotifyEvent(const void *event) diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h index 11b7429aca..e816d3c003 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.h +++ b/src/plugins/platforms/xcb/qxcbkeyboard.h @@ -64,8 +64,8 @@ public: ~QXcbKeyboard(); - void handleKeyPressEvent(QXcbWindowEventListener *eventListener, const xcb_key_press_event_t *event); - void handleKeyReleaseEvent(QXcbWindowEventListener *eventListener, const xcb_key_release_event_t *event); + void handleKeyPressEvent(const xcb_key_press_event_t *event); + void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; @@ -83,7 +83,7 @@ public: #endif protected: - void handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); + void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index f227076b3b..9aaafadcad 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -95,6 +95,7 @@ contains(QT_CONFIG, opengl) { DEFINES += $$QMAKE_DEFINES_XCB LIBS += $$QMAKE_LIBS_XCB QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB +QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB CONFIG += qpa/genericunixfontdatabase diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro index dfdcb2e83a..d0fe282b14 100644 --- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro +++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro @@ -10,6 +10,9 @@ XCB_DIR = ../../../../3rdparty/xcb INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB +QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB + # ignore compiler warnings in 3rdparty code QMAKE_CFLAGS_STATIC_LIB+=-w |