diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-04-17 12:58:41 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-04-17 12:58:52 +0200 |
commit | 64255ef6502b1144f7b0aa4b2bf62803e0d4788b (patch) | |
tree | 29bf116bfda2ccf61057115690d14f85cc9b085b /src/plugins/platforms | |
parent | 4a9fb41a7947d0bb7a47a9625603a436df288b24 (diff) | |
parent | 7e0beba891cb963a1d535bd45b0be78b43b8d07f (diff) |
Merge remote-tracking branch 'origin/api_changes'
Change-Id: I964b0a6f5c38351fdfafb8a2a128a349ff8c89d1
Diffstat (limited to 'src/plugins/platforms')
7 files changed, 44 insertions, 8 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h index f286b632fb..c28cfc5e56 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h @@ -127,6 +127,8 @@ public: bool unregisterTimers(QObject *object); QList<TimerInfo> registeredTimers(QObject *object) const; + int remainingTime(int timerId); + void wakeUp(); void interrupt(); void flush(); diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index f2927d32c1..7a1e485079 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -699,6 +699,19 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) return retVal; } +int QCocoaEventDispatcher::remainingTime(int timerId) +{ +#ifndef QT_NO_DEBUG + if (timerId < 1) { + qWarning("QCocoaEventDispatcher::remainingTime: invalid argument"); + return -1; + } +#endif + + Q_D(QCocoaEventDispatcher); + return d->timerInfoList.timerRemainingTime(timerId); +} + void QCocoaEventDispatcher::wakeUp() { Q_D(QCocoaEventDispatcher); diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index aa366da672..a6bde74103 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -854,7 +854,7 @@ int QWindowsNativeFileDialogBase::itemPaths(IShellItemArray *items, static inline void toBuffer(const QString &what, WCHAR **ptr) { const int length = 1 + what.size(); - qMemCopy(*ptr, what.utf16(), length * sizeof(WCHAR)); + memcpy(*ptr, what.utf16(), length * sizeof(WCHAR)); *ptr += length; } diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index 9c98144c4c..4dbb2cf65b 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -275,7 +275,7 @@ bool QWindowsFontEngineDirectWrite::getSfntTableData(uint tag, uchar *buffer, ui return false; } - qMemCopy(buffer, tableData, tableSize); + memcpy(buffer, tableData, tableSize); m_directWriteFontFace->ReleaseFontTable(tableContext); return true; @@ -571,7 +571,7 @@ QImage QWindowsFontEngineDirectWrite::imageForGlyph(glyph_t t, int size = width * height * 3; BYTE *alphaValues = new BYTE[size]; - qMemSet(alphaValues, size, 0); + memset(alphaValues, size, 0); hr = glyphAnalysis->CreateAlphaTexture(DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 453838ac07..38a44e2b5a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -806,12 +806,12 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent) const void QWindowsWindow::handleShown() { - QWindowSystemInterface::handleMapEvent(window()); + QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size())); } void QWindowsWindow::handleHidden() { - QWindowSystemInterface::handleUnmapEvent(window()); + QWindowSystemInterface::handleExposeEvent(window(), QRegion()); } void QWindowsWindow::setGeometry(const QRect &rectIn) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 06cc5ad123..6996c87f3f 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -162,6 +162,8 @@ void QXcbWindow::create() { destroy(); + m_deferredExpose = false; + m_configureNotifyPending = true; m_windowState = Qt::WindowNoState; Qt::WindowType type = window()->windowType(); @@ -1234,7 +1236,7 @@ void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event) // if count is non-zero there are more expose events pending if (event->count == 0) { - QWindowSystemInterface::handleSynchronousExposeEvent(window(), m_exposeRegion); + QWindowSystemInterface::handleExposeEvent(window(), m_exposeRegion); m_exposeRegion = QRegion(); } } @@ -1299,6 +1301,13 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * QPlatformWindow::setGeometry(rect); QWindowSystemInterface::handleGeometryChange(window(), rect); + m_configureNotifyPending = false; + + if (m_deferredExpose) { + m_deferredExpose = false; + QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size())); + } + m_dirtyFrameMargins = true; #if XCB_USE_DRI2 @@ -1307,13 +1316,21 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * #endif } +bool QXcbWindow::isExposed() const +{ + return m_mapped; +} + void QXcbWindow::handleMapNotifyEvent(const xcb_map_notify_event_t *event) { if (event->window == m_window) { m_mapped = true; if (m_deferredActivation) requestActivateWindow(); - QWindowSystemInterface::handleMapEvent(window()); + if (m_configureNotifyPending) + m_deferredExpose = true; + else + QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size())); } } @@ -1321,7 +1338,7 @@ void QXcbWindow::handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) { if (event->window == m_window) { m_mapped = false; - QWindowSystemInterface::handleUnmapEvent(window()); + QWindowSystemInterface::handleExposeEvent(window(), QRegion()); } } diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index d4c8804486..c8999de83d 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -85,6 +85,8 @@ public: WId winId() const; void setParent(const QPlatformWindow *window); + bool isExposed() const; + void setWindowTitle(const QString &title); void raise(); void lower(); @@ -167,6 +169,8 @@ private: bool m_mapped; bool m_transparent; bool m_deferredActivation; + bool m_deferredExpose; + bool m_configureNotifyPending; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; |