is_app_running = true;
init_plugins(pluginList);
- QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents);
+ QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
}
extern void qt_cleanupFontDatabase();
QGuiApplicationPrivate::processWindowSystemEvent(&e); // send event immediately.
}
-bool QWindowSystemInterface::sendWindowSystemEvents(QAbstractEventDispatcher *eventDispatcher, QEventLoop::ProcessEventsFlags flags)
+bool QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
{
int nevents = 0;
// For event dispatcher implementations
- static bool sendWindowSystemEvents(QAbstractEventDispatcher *eventDispatcher, QEventLoop::ProcessEventsFlags flags);
+ static bool sendWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
static int windowSystemEventsQueued();
};
return userEventSourcePrepare(source, 0);
}
-static gboolean userEventSourceDispatch(GSource *s, GSourceFunc, gpointer)
+static gboolean userEventSourceDispatch(GSource *, GSourceFunc, gpointer)
{
- GUserEventSource * source = reinterpret_cast<GUserEventSource *>(s);
- QWindowSystemInterface::sendWindowSystemEvents(source->q, QEventLoop::AllEvents);
+ QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
return true;
}
bool QUnixEventDispatcherQPA::processEvents(QEventLoop::ProcessEventsFlags flags)
{
- bool didSendEvents = QWindowSystemInterface::sendWindowSystemEvents(this, flags);
+ const bool didSendEvents = QWindowSystemInterface::sendWindowSystemEvents(flags);
if (QEventDispatcherUNIX::processEvents(flags)) {
return true;
int serial = serialNumber.load();
if (!threadData->canWait || (serial != lastSerial)) {
lastSerial = serial;
- QWindowSystemInterface::sendWindowSystemEvents(q_func(), QEventLoop::AllEvents);
+ QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
}
}
bool QQnxEventDispatcherBlackberry::processEvents(QEventLoop::ProcessEventsFlags flags)
{
- bool didSendEvents = QWindowSystemInterface::sendWindowSystemEvents(this, flags);
+ const bool didSendEvents = QWindowSystemInterface::sendWindowSystemEvents(flags);
if (QEventDispatcherBlackberry::processEvents(flags))
return true;
\ingroup qt-lighthouse-win
*/
-typedef QStack<QWindowsGuiEventDispatcher::DispatchContext> DispatchContextStack;
-
-Q_GLOBAL_STATIC(DispatchContextStack, dispatchContextStack)
-
QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(QObject *parent) :
- QEventDispatcherWin32(parent)
-{
- setObjectName(QStringLiteral("QWindowsGuiEventDispatcher_0x") + QString::number((quintptr)this, 16));
- if (QWindowsContext::verboseEvents)
- qDebug("%s %s", __FUNCTION__, qPrintable(objectName()));
- dispatchContextStack()->push(DispatchContext(this, QEventLoop::AllEvents));
-}
-
-QWindowsGuiEventDispatcher::~QWindowsGuiEventDispatcher()
+ QEventDispatcherWin32(parent), m_flags(0)
{
- if (QWindowsContext::verboseEvents)
- qDebug("%s %s", __FUNCTION__, qPrintable(objectName()));
- if (!dispatchContextStack()->isEmpty())
- dispatchContextStack()->pop();
+ setObjectName(QStringLiteral("QWindowsGuiEventDispatcher"));
}
bool QWindowsGuiEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
{
- DispatchContextStack &stack = *dispatchContextStack();
+ m_flags = flags;
if (QWindowsContext::verboseEvents > 2)
- qDebug(">%s %s %d", __FUNCTION__, qPrintable(objectName()), stack.size());
- stack.push(DispatchContext(this, flags));
+ qDebug(">%s %s %d", __FUNCTION__, qPrintable(objectName()), int(flags));
const bool rc = QEventDispatcherWin32::processEvents(flags);
- stack.pop();
if (QWindowsContext::verboseEvents > 2)
qDebug("<%s %s returns %d", __FUNCTION__, qPrintable(objectName()), rc);
return rc;
void QWindowsGuiEventDispatcher::sendPostedEvents()
{
- QWindowsGuiEventDispatcher::DispatchContext context = currentDispatchContext();
- Q_ASSERT(context.first != 0);
- QWindowSystemInterface::sendWindowSystemEvents(context.first, context.second);
-}
-
-QWindowsGuiEventDispatcher::DispatchContext QWindowsGuiEventDispatcher::currentDispatchContext()
-{
- const DispatchContextStack &stack = *dispatchContextStack();
- if (stack.isEmpty()) {
- qWarning("%s: No dispatch context", __FUNCTION__);
- return DispatchContext(0, 0);
- }
- return stack.top();
+ QWindowSystemInterface::sendWindowSystemEvents(m_flags);
}
// Helpers for printing debug output for WM_* messages.
#include "qtwindows_additional.h"
#include <QtCore/QPair>
+#include <QtCore/QEventLoop>
#include <QtCore/private/qeventdispatcher_win_p.h>
QT_BEGIN_NAMESPACE
Q_OBJECT
public:
explicit QWindowsGuiEventDispatcher(QObject *parent = 0);
- ~QWindowsGuiEventDispatcher();
-
- typedef QPair<QAbstractEventDispatcher *, QEventLoop::ProcessEventsFlags> DispatchContext;
-
- static DispatchContext currentDispatchContext();
static const char *windowsMessageName(UINT msg);
virtual bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags);
virtual void sendPostedEvents();
+
+private:
+ QEventLoop::ProcessEventsFlags m_flags;
};
QT_END_NAMESPACE
QPoint global = window->mapToGlobal(center);
QPoint delta(0, 1);
QWindowSystemInterface::handleWheelEvent(window, center, global, delta, delta, Qt::NoModifier);
- QWindowSystemInterface::sendWindowSystemEvents(app.eventDispatcher(), QEventLoop::AllEvents);
+ QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
QWindowSystemInterface::handleWheelEvent(window, center, global, delta, delta, Qt::AltModifier);
- QWindowSystemInterface::sendWindowSystemEvents(app.eventDispatcher(), QEventLoop::AllEvents);
+ QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::AltModifier);
QWindowSystemInterface::handleWheelEvent(window, center, global, delta, delta, Qt::ControlModifier);
- QWindowSystemInterface::sendWindowSystemEvents(app.eventDispatcher(), QEventLoop::AllEvents);
+ QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
// touch events