You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DISPLAY Environment Variable is used by all the applications that know about the X Protocol to find which X Server to connect to. SDL2 Libraries in other languages use this variable properly and work fine in case of multiple X Servers etc. However PySDL2 does not work if there is a fully functional X Sever on DISPLAY=:1 instead of DISPLAY=:0
To test this, we can run a simple virtual X Server in the background: $ Xvfb :1 -s '-screen 0 1920x1080x24 +iglx' &
Next we can see that SDL_Init() fails:
$ export DISPLAY=:1
$ python
>>> import sdl2
>>> sdl2.SDL_Init()
-1
>>> sdl2.SDL_GetError(sdl2.SDL_INIT_EVERYTHING)
'No available video device'
In contrast, SDL works when default DISPLAY is used:
This issue was found after building SDL2 from source with various combinations of build flags and after a week of wondering why SDL2 could not find the X server, as the X server logs remained empty all the while. All Applications that use X Servers respect this environment variable as it allows applications to work in scenarios where different X servers configured with different settings need to be run at the same time.
The text was updated successfully, but these errors were encountered:
The DISPLAY Environment Variable is used by all the applications that know about the X Protocol to find which X Server to connect to. SDL2 Libraries in other languages use this variable properly and work fine in case of multiple X Servers etc. However PySDL2 does not work if there is a fully functional X Sever on DISPLAY=:1 instead of DISPLAY=:0
To test this, we can run a simple virtual X Server in the background:
$ Xvfb :1 -s '-screen 0 1920x1080x24 +iglx' &
Next we can see that SDL_Init() fails:
In contrast, SDL works when default DISPLAY is used:
$ Xvfb :0 -s '-screen 0 1920x1080x24 +iglx' &
Next we can see that SDL_Init() fails:
This issue was found after building SDL2 from source with various combinations of build flags and after a week of wondering why SDL2 could not find the X server, as the X server logs remained empty all the while. All Applications that use X Servers respect this environment variable as it allows applications to work in scenarios where different X servers configured with different settings need to be run at the same time.
The text was updated successfully, but these errors were encountered: