37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
#include "displayserver_linux.h"
|
|
#include "common/io/io.h"
|
|
|
|
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
|
|
{
|
|
if (instance.config.general.dsForceDrm == FF_DS_FORCE_DRM_TYPE_FALSE)
|
|
{
|
|
//We try wayland as our preferred display server, as it supports the most features.
|
|
//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)
|
|
ffdsConnectXcbRandr(ds);
|
|
|
|
if(ds->displays.length == 0)
|
|
ffdsConnectXrandr(ds);
|
|
|
|
if(ds->displays.length == 0)
|
|
ffdsConnectXcb(ds);
|
|
|
|
if(ds->displays.length == 0)
|
|
ffdsConnectXlib(ds);
|
|
}
|
|
|
|
//This display detection method is display server independent.
|
|
//Use it if all connections failed
|
|
if(ds->displays.length == 0)
|
|
ffdsConnectDrm(ds);
|
|
|
|
//This fills in missing information about WM / DE by using env vars and iterating processes
|
|
ffdsDetectWMDE(ds);
|
|
}
|