[rkward-cvs] SF.net SVN: rkward-code:[4717] trunk/rkward/rkward/rbackend

tfry at users.sf.net tfry at users.sf.net
Wed Apr 24 18:04:45 UTC 2013


Revision: 4717
          http://sourceforge.net/p/rkward/code/4717
Author:   tfry
Date:     2013-04-24 18:04:44 +0000 (Wed, 24 Apr 2013)
Log Message:
-----------
Help R keep up with MouseMove events

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rkreventloop.h
    trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp

Modified: trunk/rkward/rkward/rbackend/rkreventloop.h
===================================================================
--- trunk/rkward/rkward/rbackend/rkreventloop.h	2013-04-24 17:48:37 UTC (rev 4716)
+++ trunk/rkward/rkward/rbackend/rkreventloop.h	2013-04-24 18:04:44 UTC (rev 4717)
@@ -39,6 +39,7 @@
  * R's event loop. */
 	void wakeRKEventHandler ();
 #ifdef Q_WS_WIN
+/** On Windows, Rp->Callback has to be set to this function during startup. */
 	void winRKEventHandlerWrapper (void);
 #endif
 };

Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp	2013-04-24 17:48:37 UTC (rev 4716)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp	2013-04-24 18:04:44 UTC (rev 4717)
@@ -328,6 +328,12 @@
 			if (me->buttons () & Qt::MiddleButton) sev.buttons |= RKDMouseMiddleButton;
 			if (me->buttons () & Qt::RightButton) sev.buttons |= RKDMouseRightButton;
 
+			// Mouse move event may be generated much faster than R can handle them. We simply lump them together
+			// (unless any other event type (click, release, keypress) has occurred meanwhile, of course.
+			if (!stored_events.isEmpty () && (sev.event_code == RKDMouseMove)) {
+				if (stored_events.last ().event_code == RKDMouseMove) stored_events.pop_back ();
+			}
+
 			stored_events.append (sev);
 			return (true);
 		} else if (event->type () == QEvent::KeyPress) {





More information about the rkward-tracker mailing list