summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindowsysteminterface.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-01 10:27:41 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-02 09:24:11 +0100
commitd7e4980132057aa10e54137114bf65e06c455030 (patch)
tree9d6ae36efa0cf84a612bfec6cf3dd2ea7f7e3446 /src/gui/kernel/qwindowsysteminterface.cpp
parent44c402b4bfba44480382244b8409fb3cf34d7ac1 (diff)
parenta732576a66ff2bbd9c0b41cd5f3505a4d2fbf043 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS. Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/sdk.prf src/angle/src/libEGL/libEGL.pro src/platformsupport/fontdatabases/fontdatabases.pro src/platformsupport/platformsupport.pro src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro tests/auto/widgets/widgets/qmenubar/BLACKLIST tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Task-number: QTBUG-56853 Change-Id: If58785210feee3550892fc7768cce90e75a2416c
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 08aa625112..1f2528dd5c 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -165,11 +165,11 @@ void QWindowSystemInterface::handleEnterLeaveEvent(QWindow *enter, QWindow *leav
handleEnterEvent(enter, local, global);
}
-void QWindowSystemInterface::handleWindowActivated(QWindow *tlw, Qt::FocusReason r)
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleWindowActivated, QWindow *tlw, Qt::FocusReason r)
{
QWindowSystemInterfacePrivate::ActivatedWindowEvent *e =
new QWindowSystemInterfacePrivate::ActivatedWindowEvent(tlw, r);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
+ QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
void QWindowSystemInterface::handleWindowStateChanged(QWindow *tlw, Qt::WindowState newState)
@@ -197,10 +197,25 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
/*!
If \a oldRect is null, Qt will use the previously reported geometry instead.
*/
-void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleGeometryChange, QWindow *tlw, const QRect &newRect, const QRect &oldRect)
{
QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw, QHighDpi::fromNativePixels(newRect, tlw), QHighDpi::fromNativePixels(oldRect, tlw));
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
+ QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
+}
+
+QWindowSystemInterfacePrivate::ExposeEvent::ExposeEvent(QWindow *window, const QRegion &region)
+ : WindowSystemEvent(Expose)
+ , window(window)
+ , isExposed(window && window->handle() ? window->handle()->isExposed() : false)
+ , region(region)
+{
+}
+
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleExposeEvent, QWindow *tlw, const QRegion &region)
+{
+ QWindowSystemInterfacePrivate::ExposeEvent *e =
+ new QWindowSystemInterfacePrivate::ExposeEvent(tlw, QHighDpi::fromNativeLocalExposedRegion(region, tlw));
+ QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
void QWindowSystemInterface::handleCloseEvent(QWindow *tlw, bool *accepted)
@@ -405,15 +420,6 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, con
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-
-QWindowSystemInterfacePrivate::ExposeEvent::ExposeEvent(QWindow *window, const QRegion &region)
- : WindowSystemEvent(Expose)
- , window(window)
- , isExposed(window && window->handle() ? window->handle()->isExposed() : false)
- , region(region)
-{
-}
-
int QWindowSystemInterfacePrivate::windowSystemEventsQueued()
{
return windowSystemEventQueue.count();
@@ -634,20 +640,20 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleTouchEvent, QWindow *tlw, ulong timestam
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
-void QWindowSystemInterface::handleTouchCancelEvent(QWindow *w, QTouchDevice *device,
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleTouchCancelEvent, QWindow *w, QTouchDevice *device,
Qt::KeyboardModifiers mods)
{
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
- handleTouchCancelEvent(w, time, device, mods);
+ handleTouchCancelEvent<Delivery>(w, time, device, mods);
}
-void QWindowSystemInterface::handleTouchCancelEvent(QWindow *w, ulong timestamp, QTouchDevice *device,
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleTouchCancelEvent, QWindow *w, ulong timestamp, QTouchDevice *device,
Qt::KeyboardModifiers mods)
{
QWindowSystemInterfacePrivate::TouchEvent *e =
new QWindowSystemInterfacePrivate::TouchEvent(w, timestamp, QEvent::TouchCancel, device,
QList<QTouchEvent::TouchPoint>(), mods);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
+ QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
void QWindowSystemInterface::handleScreenOrientationChange(QScreen *screen, Qt::ScreenOrientation orientation)
@@ -684,13 +690,6 @@ void QWindowSystemInterface::handleThemeChange(QWindow *tlw)
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleExposeEvent(QWindow *tlw, const QRegion &region)
-{
- QWindowSystemInterfacePrivate::ExposeEvent *e =
- new QWindowSystemInterfacePrivate::ExposeEvent(tlw, QHighDpi::fromNativeLocalExposedRegion(region, tlw));
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
-}
-
void QWindowSystemInterface::deferredFlushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
{
Q_ASSERT(QThread::currentThread() == QGuiApplication::instance()->thread());