diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2009-12-18 13:31:48 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2009-12-18 13:31:48 (GMT) |
commit | a2e77bb355382d484a39fcd5ab62a9f0bbd556da (patch) | |
tree | 6b6683ea3651e8b8cf6a874b2ad8b71f1860796a /src/plugins/graphicssystems | |
parent | 2c64beebfe265a140263ec156a0c41f93005ba73 (diff) | |
download | Qt-a2e77bb355382d484a39fcd5ab62a9f0bbd556da.zip Qt-a2e77bb355382d484a39fcd5ab62a9f0bbd556da.tar.gz Qt-a2e77bb355382d484a39fcd5ab62a9f0bbd556da.tar.bz2 |
revert queueing of VNC mouse and keyboard events
Diffstat (limited to 'src/plugins/graphicssystems')
-rw-r--r-- | src/plugins/graphicssystems/vnc/qvncserver.cpp | 46 | ||||
-rw-r--r-- | src/plugins/graphicssystems/vnc/qvncserver.h | 6 |
2 files changed, 4 insertions, 48 deletions
diff --git a/src/plugins/graphicssystems/vnc/qvncserver.cpp b/src/plugins/graphicssystems/vnc/qvncserver.cpp index c2fb676..fcff255 100644 --- a/src/plugins/graphicssystems/vnc/qvncserver.cpp +++ b/src/plugins/graphicssystems/vnc/qvncserver.cpp @@ -389,10 +389,6 @@ void QVNCServer::init(uint port) qvnc_cursor = 0; #endif encoder = 0; - - eventTimer.setInterval(0); - eventTimer.setSingleShot(true); - connect(&eventTimer, SIGNAL(timeout()), this, SLOT(sendInputEvents())); } QVNCServer::~QVNCServer() @@ -823,30 +819,6 @@ static bool buttonChange(Qt::MouseButtons before, Qt::MouseButtons after, Qt::Mo return false; } -void QVNCServer::sendInputEvents() -{ - EventPair pair; - for (int i = 0 ; i < eventList.count(); i++) { - pair = eventList[i]; - switch(pair.first) { - case MouseEvent: { - QMouseEvent *me = static_cast<QMouseEvent *>(pair.second); - QApplicationPrivate::handleMouseEvent(0, *me); - delete me; - break; - } - case KeyboardEvent: { - QKeyEvent *ke = static_cast<QKeyEvent *>(pair.second); - QApplicationPrivate::handleKeyEvent(0, ke); - delete ke; - break; - } - } - } - eventList.clear(); - Q_ASSERT(eventList.count() == 0); -} - void QVNCServer::pointerEvent() { QRfbPointerEvent ev; @@ -862,13 +834,8 @@ void QVNCServer::pointerEvent() bool isPress; if (buttonChange(buttons, ev.buttons, &button, &isPress)) type = isPress ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; - QMouseEvent * me = new QMouseEvent(type, QPoint(ev.x, ev.y), QPoint(ev.x, ev.y), button, ev.buttons, keymod); - EventPair pair; - pair.first = MouseEvent; - pair.second = me; - eventList.append(pair); - if (!eventTimer.isActive()) - eventTimer.start(); + QMouseEvent me(type, QPoint(ev.x, ev.y), QPoint(ev.x, ev.y), button, ev.buttons, keymod); + QApplicationPrivate::handleMouseEvent(0, me); buttons = ev.buttons; handleMsg = false; } @@ -894,13 +861,8 @@ void QVNCServer::keyEvent() QString str; if (ev.unicode && ev.unicode != 0xffff) str = QString(ev.unicode); - QKeyEvent *keyEvent = new QKeyEvent(type, ev.keycode, keymod, str); - EventPair pair; - pair.first = KeyboardEvent; - pair.second = keyEvent; - eventList.append(pair); - if (!eventTimer.isActive()) - eventTimer.start(); + QKeyEvent keyEvent(type, ev.keycode, keymod, str); + QApplicationPrivate::handleKeyEvent(0, &keyEvent); } handleMsg = false; } diff --git a/src/plugins/graphicssystems/vnc/qvncserver.h b/src/plugins/graphicssystems/vnc/qvncserver.h index be84c3c..79b2098 100644 --- a/src/plugins/graphicssystems/vnc/qvncserver.h +++ b/src/plugins/graphicssystems/vnc/qvncserver.h @@ -482,7 +482,6 @@ private slots: void readClient(); void checkUpdate(); void discardClient(); - void sendInputEvents(); private: void init(uint port); @@ -520,11 +519,6 @@ private: QRfbEncoder *encoder; QVNCCursor *cursor; - - enum EventType { MouseEvent, KeyboardEvent }; - QTimer eventTimer; - typedef QPair<EventType, QInputEvent *> EventPair; - QList<EventPair> eventList; }; |