Shutdown input devices if FatalError occurs during startup.
Fixes Xdmx problems when the input device has been initialized and the keyboard map has been destroyed.
This commit is contained in:
parent
acb5ff4c73
commit
c9a5f9d391
20
dix/main.c
20
dix/main.c
|
@ -414,21 +414,27 @@ main(int argc, char *argv[], char *envp[])
|
||||||
ErrorF("failed to set default font path '%s'",
|
ErrorF("failed to set default font path '%s'",
|
||||||
defaultFontPath);
|
defaultFontPath);
|
||||||
}
|
}
|
||||||
if (!SetDefaultFont(defaultTextFont))
|
if (!SetDefaultFont(defaultTextFont)) {
|
||||||
|
CloseDownDevices();
|
||||||
FatalError("could not open default font '%s'", defaultTextFont);
|
FatalError("could not open default font '%s'", defaultTextFont);
|
||||||
|
}
|
||||||
#ifdef NULL_ROOT_CURSOR
|
#ifdef NULL_ROOT_CURSOR
|
||||||
cm.width = 0;
|
cm.width = 0;
|
||||||
cm.height = 0;
|
cm.height = 0;
|
||||||
cm.xhot = 0;
|
cm.xhot = 0;
|
||||||
cm.yhot = 0;
|
cm.yhot = 0;
|
||||||
|
|
||||||
if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0)))
|
if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) {
|
||||||
|
CloseDownDevices();
|
||||||
FatalError("could not create empty root cursor");
|
FatalError("could not create empty root cursor");
|
||||||
|
}
|
||||||
AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor);
|
AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor);
|
||||||
#else
|
#else
|
||||||
if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0)))
|
if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) {
|
||||||
|
CloseDownDevices();
|
||||||
FatalError("could not open default cursor font '%s'",
|
FatalError("could not open default cursor font '%s'",
|
||||||
defaultCursorFont);
|
defaultCursorFont);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef DPMSExtension
|
#ifdef DPMSExtension
|
||||||
/* check all screens, looking for DPMS Capabilities */
|
/* check all screens, looking for DPMS Capabilities */
|
||||||
|
@ -452,13 +458,17 @@ main(int argc, char *argv[], char *envp[])
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
if (!PanoramiXCreateConnectionBlock())
|
if (!PanoramiXCreateConnectionBlock()) {
|
||||||
|
CloseDownDevices();
|
||||||
FatalError("could not create connection block info");
|
FatalError("could not create connection block info");
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (!CreateConnectionBlock())
|
if (!CreateConnectionBlock()) {
|
||||||
|
CloseDownDevices();
|
||||||
FatalError("could not create connection block info");
|
FatalError("could not create connection block info");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatch();
|
Dispatch();
|
||||||
|
|
Loading…
Reference in New Issue