pokepetter / ursina

A game engine powered by python and panda3d.
https://pokepetter.github.io/ursina/
MIT License
2.23k stars 326 forks source link

"Monitor not found" in Debian BookWorm linux #602

Closed Daniel-poket-45 closed 1 year ago

Daniel-poket-45 commented 1 year ago

exit error:

warning: no monitors found :prc(warning): Invalid integer value for ConfigVariable win-size: 576.0 :prc(warning): Invalid integer value for ConfigVariable win-size: 1024.0 Known pipe types: glxGraphicsPipe (4 aux display modules not yet loaded.) Traceback (most recent call last): File "/home/daniel/Isolated Storage/Voxel-Live/DAN-X VL-Vox/voxel_editor.py", line 3, in app = Ursina( ^^^^^^^ File "/home/daniel/Isolated Storage/lib/python3.11/site-packages/ursina/scripts/singleton_decorator.py", line 4, in getinstance cls._instance = cls(**kwargs) ^^^^^^^^^^^^^ File "/home/daniel/Isolated Storage/lib/python3.11/site-packages/ursina/main.py", line 66, in init window.apply_settings() File "/home/daniel/Isolated Storage/lib/python3.11/site-packages/ursina/window.py", line 83, in apply_settings self.center_on_screen() File "/home/daniel/Isolated Storage/lib/python3.11/site-packages/ursina/window.py", line 121, in center_on_screen x = self.main_monitor.x + ((self.main_monitor.width - self.size[0]) / 2) ^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'x'

in windows 8.1/10/11 systems on the same pc and monitor this code run, but in linux DEBIAN BOOKWORM 12 its not run, the code is, the python interpreter is in venv because the problem with PEP-668 in the bookworm system, block the pip install:

from ursina import *

app = Ursina( title='VoxelCore', borderless=False, development_mode=True )

app.run()

anyone know how do i fix this error? thanks for your attention :)

sheeperino commented 1 year ago

I'm on Ubuntu 23. I used this command python -m screeninfo xrandr which output Monitor(x=0, y=0, width=1920, height=1080, width_mm=598, height_mm=336, name='HDMI-A-0', is_primary=False) so I changed the primary flag with xrandr like this: xrandr --output HDMI-A-0 --primary.