[rkward-cvs] SF.net SVN: rkward:[2395] branches/release_branch_0.4.9

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Nov 21 20:43:19 UTC 2008


Revision: 2395
          http://rkward.svn.sourceforge.net/rkward/?rev=2395&view=rev
Author:   tfry
Date:     2008-11-21 20:43:19 +0000 (Fri, 21 Nov 2008)

Log Message:
-----------
Backport relevant portions of 2389 (fix device capturing for R 2.8.0)

Modified Paths:
--------------
    branches/release_branch_0.4.9/ChangeLog
    branches/release_branch_0.4.9/rkward/rbackend/rpackages/rkward/R/internal.R
    branches/release_branch_0.4.9/rkward/rkwardapplication.cpp
    branches/release_branch_0.4.9/rkward/settings/rksettingsmoduler.cpp

Modified: branches/release_branch_0.4.9/ChangeLog
===================================================================
--- branches/release_branch_0.4.9/ChangeLog	2008-11-21 20:41:18 UTC (rev 2394)
+++ branches/release_branch_0.4.9/ChangeLog	2008-11-21 20:43:19 UTC (rev 2395)
@@ -1,3 +1,4 @@
+- Fix device window capturing with R 2.8.0
 - added bunch of irt analysis an plot plug-ins by meik michalke
 
 --- Version 0.4.9a - Apr-20-2008

Modified: branches/release_branch_0.4.9/rkward/rbackend/rpackages/rkward/R/internal.R
===================================================================
--- branches/release_branch_0.4.9/rkward/rbackend/rpackages/rkward/R/internal.R	2008-11-21 20:41:18 UTC (rev 2394)
+++ branches/release_branch_0.4.9/rkward/rbackend/rpackages/rkward/R/internal.R	2008-11-21 20:43:19 UTC (rev 2395)
@@ -141,16 +141,26 @@
 #}
 
 # overriding x11 to get informed, when a new x11 window is opened
-"x11" <- function (...) {
+"rk.screen.device" <- function (...) {
 	.rk.do.call ("startOpenX11", as.character (dev.cur ()));
 
-	x <- grDevices::X11 (...)
+	if (!exists (".rk.default.device")) {
+		device <- grDevices::x11
+	} else {
+		device <- .rk.default.device
+		if (is.character (.rk.default.device)) {
+			device <- get (.rk.default.device)
+		}
+	}
+	x <- device (...)
 
 	.rk.do.call ("endOpenX11", as.character (dev.cur ()));
 
 	invisible (x)
 }
 
+"x11" <- rk.screen.device
+
 "X11" <- x11
 
 # these functions can be used to track assignments to R objects. The main interfaces are .rk.watch.symbol (k) and .rk.unwatch.symbol (k). This works by copying the symbol to a backup environment, removing it, and replacing it by an active binding to the backup location

Modified: branches/release_branch_0.4.9/rkward/rkwardapplication.cpp
===================================================================
--- branches/release_branch_0.4.9/rkward/rkwardapplication.cpp	2008-11-21 20:41:18 UTC (rev 2394)
+++ branches/release_branch_0.4.9/rkward/rkwardapplication.cpp	2008-11-21 20:43:19 UTC (rev 2395)
@@ -96,8 +96,9 @@
 		if (e->type == CreateNotify) {
 			if (e->xcreatewindow.parent == qt_xrootwin ()) {
 				KWin::WindowInfo info = KWin::windowInfo (e->xcreatewindow.window);
-				if ((info.windowType (0xFFFF) != 0) && (!info.name ().isEmpty ())) {
-					RK_ASSERT (!created_window);
+				// at this point, we used to check, whether this window has some name or another. This heuristic allowed to sieve out helper windows of the window manager. However, since R 2.8.0, sometimes the window is mapped, before it has been give a name.
+				// Now we rely on the fact (we hope it *is* a fact), that the device window is always the first one created.
+				if ((info.windowType (0xFFFF) != 0) && (!created_window)) {
 					created_window = e->xcreatewindow.window;
 					return true;
 				}

Modified: branches/release_branch_0.4.9/rkward/settings/rksettingsmoduler.cpp
===================================================================
--- branches/release_branch_0.4.9/rkward/settings/rksettingsmoduler.cpp	2008-11-21 20:41:18 UTC (rev 2394)
+++ branches/release_branch_0.4.9/rkward/settings/rksettingsmoduler.cpp	2008-11-21 20:43:19 UTC (rev 2395)
@@ -216,6 +216,9 @@
 	list.append ("options (checkbounds=" + tf + ")\n");
 	list.append ("options (printcmd=\"" + options_printcmd + "\")\n");
 
+#warning TODO make configurable
+	list.append ("options (device=rk.screen.device)\n");
+
 	return list;
 }
 


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