[R-SIG-Mac] Problems with Rcmdr via XQuartz on OSX Mavericks

John Fox jfox at mcmaster.ca
Thu Nov 28 15:04:24 CET 2013


Dear Philippe,

Thanks for this. Since I can already tell when R is running under Mac OS X, that should solve the problem of differentiating R.app and R running in a terminal.

Best,
 John

On Thu, 28 Nov 2013 14:54:52 +0100
 Philippe Grosjean <phgrosjean at sciviews.org> wrote:
> 
> On 28 Nov 2013, at 14:38, John Fox <jfox at mcmaster.ca> wrote:
> 
> > Dear Peter,
> > 
> > On Thu, 28 Nov 2013 12:00:31 +0100
> > peter dalgaard <pdalgd at gmail.com> wrote:
> >> 
> >> On 28 Nov 2013, at 01:46 , John Fox <jfox at mcmaster.ca> wrote:
> >> 
> >>> Hi Rob,
> >>> 
> >>> I had some time today and so I started to implement this solution in the
> >>> Rcmdr. I first tested whether setting
> >>> 
> >>> system("defaults write org.R-project.R NSAppSleepDisabled -bool yes")
> >>> 
> >>> fixes the problem; I verified via 
> >>> 
> >>> system("defaults read org.R-project.R NSAppSleepDisabled")
> >>> 
> >>> that the key was in fact set properly. 
> >>> 
> >>> I'm afraid that even with NSAppSleepDisabled set, the Rcmdr still freezes
> >>> periodically. Whatever is going on is probably more complicated than
> >>> power-saving.
> >>> 
> >> 
> >> Hmm. The tkfaq issue seems to have gone away for me. You did remember to restart R.app after setting the key?
> >> 
> > 
> > I didn't "remember" to restart R.app because I didn't know that it was necessary to do so. In fact, the code that I wrote, but didn't commit, for the Rcmdr carefully resets the key to its previous state or deletes it if it didn't previously exist when the Commander is closed.
> > 
> > I think that you've almost surely identified my problem, but the solution also raises a question about what to do. I'm reluctant to have the Rcmdr make a permanent change to users' OS settings. I guess that I could detect whether the NSAppSleepDisabled key is set and pop up a dialog box if it isn't, offering to make the change, and suggesting that the user restart R.app. (BTW, is there an easy way to check whether R is running in R.app or a terminal?)
> 
> Look at svMisc::isAqua(), which uses indeed .Platform$GUI returning "Aqua" on R.app or "X11" on R under a terminal. I am not sure, however, that R on a terminal returns *always* "X11".
> Best,
> 
> Philippe
> 
> > Wouldn't it be better to handle this issue in R.app or even in tcltk, however?
> > 
> > If restarting R.app after setting the NSAppSleepDisabled key doesn't work for me, I'll then pursue Rob's suggestions.
> > 
> > Thanks for this,
> > John
> 
> 
> 
> 
> [
]



More information about the R-SIG-Mac mailing list