[rkward-cvs] SF.net SVN: rkward:[2764] branches/release_branch_0.4.9/rkward/rbackend/ rembedinternal.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sat Mar 6 11:44:49 UTC 2010


Revision: 2764
          http://rkward.svn.sourceforge.net/rkward/?rev=2764&view=rev
Author:   tfry
Date:     2010-03-06 11:44:48 +0000 (Sat, 06 Mar 2010)

Log Message:
-----------
Backport new version of processX11Events() from trunk.
This is needed to keep the R 2.10 help server talking.

Modified Paths:
--------------
    branches/release_branch_0.4.9/rkward/rbackend/rembedinternal.cpp

Modified: branches/release_branch_0.4.9/rkward/rbackend/rembedinternal.cpp
===================================================================
--- branches/release_branch_0.4.9/rkward/rbackend/rembedinternal.cpp	2010-03-06 11:43:48 UTC (rev 2763)
+++ branches/release_branch_0.4.9/rkward/rbackend/rembedinternal.cpp	2010-03-06 11:44:48 UTC (rev 2764)
@@ -464,8 +464,29 @@
 
 static int timeout_counter = 0;
 
+#ifdef R_2_7
+void processX11EventsWorker (void *) {
+// this basically copied from R's unix/sys-std.c (Rstd_ReadConsole)
+	for (;;) {
+		fd_set *what;
+		what = R_checkActivityEx(R_wait_usec > 0 ? R_wait_usec : 50, 1, Rf_onintr);
+		R_runHandlers(R_InputHandlers, what);
+		if (what == NULL) break;
+	}
+	/* This seems to be needed to make Rcmdr react to events. Has this always been the case? It was commented out for a long time, without anybody noticing. */
+	R_PolledEvents ();
+}
+
 void REmbedInternal::processX11Events () {
+	// do not trace
 	if (!this_pointer->r_running) return;
+
+// In case an error (or user interrupt) is caught inside processX11EventsWorker, we don't want to long-jump out.
+	R_ToplevelExec (processX11EventsWorker, 0);
+}
+#else
+void REmbedInternal::processX11Events () {
+	if (!this_pointer->r_running) return;
 /* what we do here is walk the list of objects, that have told R, they're listening for events.
 We figure out which ones look for X11-events and tell those to do their stuff (regardless of whether events actually occurred) */
 	extern InputHandler *R_InputHandlers;
@@ -488,6 +509,7 @@
 		timeout_counter = 0;
 	}
 }
+#endif
 
 QString *SEXPToStringList (SEXP from_exp, unsigned int *count) {
 	RK_TRACE (RBACKEND);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list