Skip to content

Commit

Permalink
Merge branch 'v0.94'
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jul 3, 2011
2 parents f872f21 + 556d72c commit ef4605d
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/cpp/r/session/graphics/RGraphicsDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,38 +526,6 @@ SEXP devSetHook(SEXP call, SEXP op, SEXP args, SEXP rho)
return s_originalDevSetFunction(call, op, args, rho);
}


CCODE s_originalInteractiveFunction;
SEXP interactiveHook(SEXP call, SEXP op, SEXP args, SEXP rho)
{
try
{
// NOTE: this technique has the side effect that a call to interactive()
// when there is no device will result in our device being created
// and the Plots tab coming to the front. there are very few calls to
// the interactive() function within R so this may not be a practical
// issue. an alternative implementation would be to hook the R
// dev.interactive function directly and detect the "no devices" special
// case and return TRUE for this.


// call to interactive() is an indicator that that someone may be
// querying for dev.interactive(). in this case if we are not yet
// initialized and there is no active device then we need to initialize
// and make ourselves active so that dev.interactive returns TRUE
if (Rf_NoDevices())
{
Error error = makeActive();
if (error)
LOG_ERROR(error);
}
}
CATCH_UNEXPECTED_EXCEPTION

// always call original
return s_originalInteractiveFunction(call, op, args, rho);
}

DisplaySize displaySize()
{
return DisplaySize(s_width, s_height);
Expand Down Expand Up @@ -680,14 +648,6 @@ Error initialize(
if (error)
return error;

// register interactive() hook to work around dev.interactive device
// bootstrapping bug
error = function_hook::registerReplaceHook("interactive",
interactiveHook,
&s_originalInteractiveFunction);
if (error)
return error;

// initialize
return r::exec::RFunction(".rs.initGraphicsDevice").call();
}
Expand Down

0 comments on commit ef4605d

Please sign in to comment.