diff --git a/src/detection/displayserver/linux/wayland/mutter.c b/src/detection/displayserver/linux/wayland/mutter.c index 05bcfbfcf..7a37bfc6f 100644 --- a/src/detection/displayserver/linux/wayland/mutter.c +++ b/src/detection/displayserver/linux/wayland/mutter.c @@ -387,7 +387,8 @@ bool ffdsMutterAvailable(void) { } // Enrich the displays detected from wl_output with the authoritative data reported by Mutter / Muffin. -// Returns true if the display configuration could be retrieved from D-Bus. +// Returns true when the D-Bus connection is up and DisplayConfig could be queried. The caller treats +// that as authoritative and skips monitors.xml, even if the reply names no primary monitor. bool ffdsConnectMutter(FFDisplayServerResult* result) { FF_DBUS_AUTO_DESTROY_DATA FFDBusData dbus = {}; const char* error = ffDBusLoadData(DBUS_BUS_SESSION, &dbus); diff --git a/src/detection/displayserver/linux/wayland/wayland.c b/src/detection/displayserver/linux/wayland/wayland.c index e86fa3b64..ff29dc2c0 100644 --- a/src/detection/displayserver/linux/wayland/wayland.c +++ b/src/detection/displayserver/linux/wayland/wayland.c @@ -317,16 +317,18 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) { data.ffwl_proxy_destroy(registry); ffwl_display_disconnect(data.display); - bool primaryDetected = false; + bool displayConfigRead = false; #if defined(FF_HAVE_DBUS) && defined(__linux__) if (data.useMutter) { - // Mutter / Muffin reports the primary monitor and the raw EDID directly - primaryDetected = ffdsConnectMutter(result); + // A working D-Bus connection with a reachable DisplayConfig is authoritative. + // Don't second-guess it with monitors.xml even when the reply names no primary + // monitor (e.g. connector names that happen to match no wl_output). + displayConfigRead = ffdsConnectMutter(result); } #endif // Fallback for compositors that do not expose the monitor configuration, or when it could not be read - if (!primaryDetected) { + if (!displayConfigRead) { const char* fileName = ffStrbufEqualS(&result->wmProcessName, "gnome-shell") ? "monitors.xml" : ffStrbufEqualS(&result->wmProcessName, "cinnamon")