Fullscreen causing timing issue

Hi! When fullscr=True, stimulus duration would be less than expected (133ms). This problem is gone when the images were not presented in fullscreen. Does anyone know why and how to present the stimuli in fullscreen while having the correct timings?
Monitor refresh rate matches with psychopy. There are 900 images in total, each repeats 12 times.

What version of PsychoPy and what operating system please.

It is psychopy 2022.2.5 on windows.

I would like to second this issue. I also played around, trying various things to find where the issue might be coming from and got frustratingly inconsistent results. I ran this simple piece of code that shows (or should show) a white square on the screen for exactly one frame every time I press spacebar. I originally ran it on a computer (let’s call it PC1) connected to a 60Hz LCD monitor.

from psychopy import  core, visual, event

win = visual.Window((1920,1080), color="black", units="pix", fullscr=**False**)
shape = visual.Rect(win, width=100, height=100, fillColor = "white", lineColor = None)

while True:
    shape.draw()
    start = win.flip() # display stimulus
    end = win.flip() # hide stimulus
    print(end-start)
    
    while True:
        if event.getKeys(["space"]): break
        elif event.getKeys(["escape"]): core.quit()

If fullscr==False, the print gave me values generally between 17 and 19 ms for each button press, which is about what I would expect, even though it’s not as precise as it should be (expected value is 16.6 ms). However, if I change fullscr to True, the values are all over the place, from 4 to 19 ms.

I proceeded to test this with various different setups. I tried using PC1 with a 120 Hz projector. Same issue—with fullscr==False, I get consistent but imprecise values (about 10 ms, should be 8.3); with fullscr==True, I get values anywhere between 3 and 12 ms.

I tried using a different computer (PC2) with a 60 Hz LCD monitor first and a 240 Hz LCD second. Same problem.

I tried my 144 Hz laptop, same problem. I also tried setting my laptop refresh rate to 60 Hz → same issue.

BUT, halfway through the test with my laptop at 60 Hz, with literally nothing changing, just running the code multiple times, the print suddenly started showing 16.6 ms (which was both consistent and actually precise). I have absolutely no clue what changed. I didn’t close any programs, the time elapsed between the run with the issue and the run without the issue was at most 5 seconds.

I returned back to PC1 and PC2 in all the configurations described above, ran the code several times, but the issue never corrected itself as it did in my laptop. Same with my laptop at 144 Hz—still inconsistent with fullscr==True and inaccurate with fullscr==False. But returning it to 60 Hz now seems to solve the problem.

All the computers run Windows 10. PC1 and my laptop run Python 3.10.12 with pip-installed PsychoPy 2023.1.3. PC2 is an older setup, running standalone PsychoPy 2020.2.10. I should add that win.monitorFramePeriod gives me the correct value in all setups.

Any clue, anyone, please?