Skip to content

Commit

Permalink
cosmetic, specify screen
Browse files Browse the repository at this point in the history
  • Loading branch information
denispelli committed Jun 24, 2020
1 parent 583068c commit 8819020
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/RunExperiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
% TO DO: DELETE OBSOLETE EXPERIMENT SUMMARY. Once we save the new file we
% ought to delete the old partial, since its data are now obsolete,
% duplicated in the new complete experiment file.
mainFolder=fileparts(fileparts(mfilename('fullpath'))); % Takes 0.1 s.
addpath(fullfile(mainFolder));

% Once we call onCleanup, until RunExperiment ends, CloseWindowsAndCleanup
% will run (closing any open windows) when this function terminates for any
Expand Down Expand Up @@ -172,15 +174,13 @@
%% Clean up whenever RunExperiment terminates, even by control-C.
function CloseWindowsAndCleanup()
% Close any window opened by the Psychtoolbox Screen command, and re-enable keyboard.
global window oldDisplasySettings
global window oldDisplaySettings screen
if ~isempty(Screen('Windows'))
% Screen CloseAll is very slow, so we call it only if we need to.
Screen('CloseAll');
% sca; % Originally equivalent to Screen('CloseAll').
% sca; % Originally equivalent to Screen('CloseAll').
if ismac
% We ought to specify the screen here, but I don't think it's yet a
% global.
MacDisplaySettings(oldDisplasySettings);
MacDisplaySettings(screen,oldDisplaySettings);
end
end
window=[];
Expand Down

0 comments on commit 8819020

Please sign in to comment.