DisplayServer (Android): enables Wayland support

Fixes #2530
This commit is contained in:
Carter Li
2026-08-25 13:32:28 +08:00
parent 143939f19b
commit 880284fa9c
2 changed files with 25 additions and 8 deletions
@@ -192,13 +192,23 @@ static bool detectDE(FFDisplayServerResult* ds) {
}
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds) {
const char* error = ffdsConnectXcbRandr(ds);
if (error) {
error = ffdsConnectXrandr(ds);
}
if (!error) {
ffdsDetectWMDE(ds);
return;
// Keep the same display-server preference as Linux: Wayland provides the
// richest output information, followed by XCB and XRandR.
if (instance.config.general.dsForceDrm == FF_DS_FORCE_DRM_TYPE_FALSE) {
ffdsConnectWayland(ds);
if (ds->displays.length == 0) {
ffdsConnectXcbRandr(ds);
}
if (ds->displays.length == 0) {
ffdsConnectXrandr(ds);
}
if (ds->displays.length > 0) {
ffdsDetectWMDE(ds);
return;
}
}
// https://source.android.com/docs/core/graphics/surfaceflinger-windowmanager