DisplayServer (Linux): try fixing #505

This commit is contained in:
李通洲
2023-08-01 15:15:03 +08:00
parent 5562bc6264
commit aa49877610
@@ -1,4 +1,5 @@
#include "displayserver_linux.h"
#include "common/io/io.h"
#include "util/stringUtils.h"
#include <dirent.h>
@@ -81,21 +82,25 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
//This method can't detect the name of our WM / DE
ffdsConnectWayland(ds);
//Try the x11 libs, from most feature rich to least.
//We use the display list to detect if a connection is needed.
//They respect wmProtocolName, and only detect display if it is set.
if(ds->displays.length == 0)
{
//Try the x11 libs, from most feature rich to least.
//We use the display list to detect if a connection is needed.
//They respect wmProtocolName, and only detect display if it is set.
FF_SUPPRESS_IO(); // #505
ffdsConnectXcbRandr(ds);
if(ds->displays.length == 0)
ffdsConnectXrandr(ds);
if(ds->displays.length == 0)
ffdsConnectXrandr(ds);
if(ds->displays.length == 0)
ffdsConnectXcb(ds);
if(ds->displays.length == 0)
ffdsConnectXcb(ds);
if(ds->displays.length == 0)
ffdsConnectXlib(ds);
if(ds->displays.length == 0)
ffdsConnectXlib(ds);
}
}
//This display detection method is display server independent.