mi: Don't log the full extension list on disable

When enabling or disabling an extension which is not known to the
Xserver, it will log an error message and list the extensions it knows
about.

That clutters the logs when the Xserver is Xwayland spawned by the
Wayland compositor who doesn't actually know the list of extensions
enabled at build time in the Xserver.

Considering that disabling a non-existing extension is a no-op anyway,
list all the extensions available only when attempting to enable an
extension which the Xserver doesn't know about.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
Olivier Fourdan 2020-09-08 18:34:48 +02:00 committed by Olivier Fourdan
parent 4341f1da72
commit a81c98e42a

View File

@ -221,8 +221,12 @@ EnableDisableExtensionError(const char *name, Bool enable)
break; break;
} }
} }
if (found == FALSE) if (found == FALSE) {
ErrorF("[mi] Extension \"%s\" is not recognized\n", name); ErrorF("[mi] Extension \"%s\" is not recognized\n", name);
/* Disabling a non-existing extension is a no-op anyway */
if (enable == FALSE)
return;
}
ErrorF("[mi] Only the following extensions can be run-time %s:\n", ErrorF("[mi] Only the following extensions can be run-time %s:\n",
enable ? "enabled" : "disabled"); enable ? "enabled" : "disabled");
for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) { for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {