Calibration doesn't go to second screen (Solved)

Hi folks,

I’m trying to develop a psychophysical eyetracking task by PsychoPy to be able to work with Eylink and Mouse simulation eyetracking. Indeed, I have two screens one for the experimenter and one for the subject.
I made a Window following code line below:

win = visual.Window(allowGUI=True, monitor=mon, units='pix', screen=1, color=(-0.2, -0.2, -0.2), fullscr=True, colorSpace='rgb')

Then, I configured the calibration target and calibration object and I put the “win” as their input argument:

calibrationTarget = visual.TargetStim(win,
                                          radius=100, fillColor='white', borderColor='white', lineWidth=5.0,
                                          innerRadius=2.0, innerFillColor='green', innerBorderColor='white',
                                          colorSpace='rgb', units="pix")
calibration = hardware.eyetracker.EyetrackerCalibration(win, eyetracker, calibrationTarget,
                                                        units=None, colorSpace='rgb',
                                                        progressMode='time', targetDur=1.5, expandScale=1.5,
                                                        targetLayout='FIVE_POINTS', randomisePos=True,
                                                        movementAnimation=True, targetDelay=1.0)

And after running calibration by the code line “”, for a moment a window is opening on the second screen then immediately the calibration window opens on the first screen.
Without using calibration, my task opens on the second screen.

I am very grateful for your help in advance.

I am using:

Windows 10
Python 3.8 (in 3.10 got the same result)
PsychoPy version 2022.2.4 (in previous versions also I got the same result)

I think this is a bug. in the following file:
line 55 to 58 is like below:

    if self.getIndex() >= self.getDisplayCount():
        # Requested Display index is invalid. Use Display / Screen index 0.
        print2err("WARNING: Requested display index does not exist. Using display index 0.")
        self.device_number = 0

which always gives 0. By this trick, a line before “if” putting “self.device_number = 1” it will work.

But this is a temporary trick. I need a good solution.

Can someone guide me on how to report this bug?

Well, after struggling a lot, I found out this is not a bug. Just simply put “win” as an input argument in the dictionary to the lunchHubServer. And it will work.

In this way, the mouse simulation will work perfectly. I had put another post here (The mouse positions of mouse gaze are always zero) and now that problem is also solved.