Hi, I stumbled upon this problem in a mac os device. the same code runs perfectly on my windows laptop. the problem is that when opening an experiment in fullscreen mode, the screen would go completely black but the mouse is visible, no error no nothing. the experiment runs smoothly in windows mode (fullscr = False). and I am almost sure that this problem has nothing to do with the code or anything. to prove my point I used the demo codes available in the psychopy itself. hello world code. just a simple grey screen which says hello world. that’s it. runs perfectly in windows mode and goes completely black in fullscreen mode. mac os Big Sur
any ideas?
here’s the code for those who want it.
# Import key parts of the PsychoPy library:
from psychopy import visual, core
# Create a visual window:
win = visual.Window(units="height",fullscr=True)
# Create (but not yet display) some text:
msg1 = visual.TextBox2(win,
text=u"Hello world!",
font="Open Sans", letterHeight=0.1,
pos=(0, 0.2))
msg2 = visual.TextBox2(win,
text=u"\u00A1Hola mundo!",
font="Open Sans", letterHeight=0.1,
pos=(0, -0.2))
# Draw the text to the hidden visual buffer:
msg1.draw()
msg2.draw()
# Show the hidden buffer--everything that has been drawn since the last win.flip():
win.flip()
# Wait 3 seconds so people can see the message, then exit gracefully:
core.wait(3)
win.close()
core.quit()
The contents of this file are in the public domain.
I can’t see nothing expect black screen. But I still tried to press some key even. Then I found it ran (because It really save some data according to code).The only problem is that nothing can be draw to the screen.
I also encountered this problem.
On my two macOs devices, the full screen appears black for the window alone.
from psychopy import event,visual
win = visual.Window(
size=(2048,1152),
pos=(0,0),
units=“pix”,
fullscr=True,
color=[1,1,1]) #should be a white background
win.flip()
event.waitKeys()
win.close()
The first thing to check is whether your experiment has stalled altogether or it’s just running and not displaying - try running an experiment that’s just a Keyboard component with duration 10 seconds and a Code component with this in the Each Frame tab:
if "space" in myKeyboard.getKeys():
print("SPACE")
then press the space bar a few times before the experiment finishes. Do you see SPACE in the output in Runner? And did the experiment run through to completion?
No @Nicobruno92 I have no idea. When I test using 2022.2.4 on my MacBook Pro (intel, running MacOS 12.6 Monterey) the code above works fine.
Is there anything at all unusual about your setup that would explain why this is happening for some, but not most, users? Are you using Standalone? What version?
Got the same problem here on my MacOS BigSur MacBook Pro (13-inch, M1, 2020), it just shows black screen and not executing the "win= " sentence when fullscr=True. But everything works perfectly when i change fullscr = False
Please see this defect report on the JDK ‘bugs’ forum. They reported black screens for Java’s full screen mode on OS 13 and above. This looks to have a fix on the upcoming java 23 version.