diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-13 18:04:17 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-13 18:04:17 +0200 |
commit | f7837e28b5f83d116fa43d0401b7188ce27fc346 (patch) | |
tree | 3de2560e4259f22224f334be17618386860decc7 /src/plugins/platforms | |
parent | 8b0624182bd4998d32c23eded5dbe6dccfd26d5b (diff) | |
parent | 44a58de2aea6d2ac71efe7261a398effbf139f3f (diff) |
Merge branch 'stable' into dev
Conflicts:
src/concurrent/qtconcurrentmedian.h
src/corelib/itemmodels/qabstractitemmodel.cpp
Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 9 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxnativeinterface.cpp | 8 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxnativeinterface.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsbackingstore.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 3 |
8 files changed, 29 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index ca2a15a1cc..f75b3e35ca 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -70,6 +70,7 @@ QT_END_NAMESPACE Qt::KeyboardModifiers currentWheelModifiers; bool m_subscribesForGlobalFrameNotifications; QCocoaGLContext *m_glContext; + bool m_drawRectHasBeenCalled; bool m_shouldSetGLContextinDrawRect; } diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index b8a31329fe..ea8e1b363b 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -87,6 +87,7 @@ static QTouchDevice *touchDevice = 0; m_sendKeyEvent = false; m_subscribesForGlobalFrameNotifications = false; m_glContext = 0; + m_drawRectHasBeenCalled = false; m_shouldSetGLContextinDrawRect = false; currentCustomDragTypes = 0; m_sendUpAsRightButton = false; @@ -153,9 +154,9 @@ static QTouchDevice *touchDevice = 0; - (void) setQCocoaGLContext:(QCocoaGLContext *)context { m_glContext = context; - [m_glContext->nsOpenGLContext() setView:self]; - if (![m_glContext->nsOpenGLContext() view]) { - //was unable to set view + if (m_drawRectHasBeenCalled) { + [m_glContext->nsOpenGLContext() setView:self]; + } else { m_shouldSetGLContextinDrawRect = true; } @@ -392,6 +393,8 @@ static QTouchDevice *touchDevice = 0; m_shouldSetGLContextinDrawRect = false; } + m_drawRectHasBeenCalled = true; + if (!m_backingStore) return; diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp index e147ca72e5..4dd3444832 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp @@ -62,4 +62,12 @@ void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, Q return 0; } +void *QQnxNativeInterface::nativeResourceForScreen(const QByteArray &resource, QScreen *screen) +{ + if (resource == "QObject*" && screen) + return static_cast<QObject*>(static_cast<QQnxScreen*>(screen->handle())); + + return 0; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.h b/src/plugins/platforms/qnx/qqnxnativeinterface.h index d84df205e5..6692da2576 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.h +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.h @@ -50,6 +50,7 @@ class QQnxNativeInterface : public QPlatformNativeInterface { public: void *nativeResourceForWindow(const QByteArray &resource, QWindow *window); + void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index d940b35861..69e672aefc 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -573,8 +573,10 @@ void QQnxScreen::addUnderlayWindow(screen_window_t window) void QQnxScreen::removeOverlayOrUnderlayWindow(screen_window_t window) { const int numRemoved = m_overlays.removeAll(window) + m_underlays.removeAll(window); - if (numRemoved > 0) + if (numRemoved > 0) { updateHierarchy(); + Q_EMIT foreignWindowClosed(window); + } } void QQnxScreen::newWindowCreated(void *window) @@ -608,6 +610,7 @@ void QQnxScreen::newWindowCreated(void *window) addUnderlayWindow(windowHandle); else addOverlayWindow(windowHandle); + Q_EMIT foreignWindowCreated(windowHandle); } } } diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index e498d27c14..fd97e2e58f 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -98,6 +98,10 @@ public: QPlatformCursor *cursor() const; +Q_SIGNALS: + void foreignWindowCreated(void *window); + void foreignWindowClosed(void *window); + public Q_SLOTS: void setRotation(int rotation); void newWindowCreated(void *window); diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index dfbbe3069c..26205eb146 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -88,8 +88,10 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion, QWindowsWindow *rw = QWindowsWindow::baseWindowOf(window); #ifndef Q_OS_WINCE + const bool hasAlpha = rw->format().hasAlpha(); const Qt::WindowFlags flags = window->flags(); - if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, rw->format().hasAlpha(), rw->opacity())) { + if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) { + // Windows with alpha: Use blend function to update. QRect r = window->frameGeometry(); QPoint frameOffset(window->frameMargins().left(), window->frameMargins().top()); QRect dirtyRect = br.translated(offset + frameOffset); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index f3faccbc14..7077eaf4b0 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -314,7 +314,8 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qr Q_UNUSED(level); #else if (QWindowsWindow::setWindowLayered(hwnd, flags, hasAlpha, level)) { - if (flags & Qt::FramelessWindowHint) { + if (hasAlpha && (flags & Qt::FramelessWindowHint)) { + // Windows with alpha: Use blend function to update. BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * level), AC_SRC_ALPHA}; QWindowsContext::user32dll.updateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA); } else { |