Index: programs/Xserver/hw/xfree86/common/xf86Events.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- programs/Xserver/hw/xfree86/common/xf86Events.c 30 Jul 2004 20:56:53 -0000 1.3 +++ programs/Xserver/hw/xfree86/common/xf86Events.c 11 Oct 2004 09:58:04 -0000 1.4 @@ -49,7 +49,7 @@ */ /* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.3 2004/07/30 20:56:53 eich Exp $ */ /* [JCH-96/01/21] Extended std reverse map to four buttons. */ @@ -1334,6 +1334,10 @@ ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n", BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE)); #endif +#ifdef DPMSExtension + if (DPMSPowerLevel != DPMSModeOn) + DPMSSet(DPMSModeOn); +#endif for (i = 0; i < xf86NumScreens; i++) { if (!(dispatchException & DE_TERMINATE)) if (xf86Screens[i]->EnableDisableFBAccess) @@ -1353,13 +1357,9 @@ } #endif /* !__UNIXOS2__ */ xf86EnterServerState(SETUP); - for (i = 0; i < xf86NumScreens; i++) { -#ifdef DPMSExtension - if (xf86Screens[i]->DPMSSet) - xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0); -#endif + for (i = 0; i < xf86NumScreens; i++) xf86Screens[i]->LeaveVT(i, 0); - } + for (ih = InputHandlers; ih; ih = ih->next) xf86DisableInputHandler(ih); xf86AccessLeave(); /* We need this here, otherwise */ Index: programs/Xserver/hw/xfree86/common/xf86Init.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v retrieving revision 1.12 retrieving revision 1.14 diff -u -r1.12 -r1.14 --- programs/Xserver/hw/xfree86/common/xf86Init.c 20 Aug 2004 05:22:39 -0000 1.12 +++ programs/Xserver/hw/xfree86/common/xf86Init.c 11 Oct 2004 09:58:04 -0000 1.14 @@ -96,6 +96,7 @@ #ifdef DPMSExtension #define DPMS_SERVER #include "extensions/dpms.h" +#include "dpmsproc.h" #endif @@ -1244,7 +1245,7 @@ /* * try to deinitialize all input devices */ - if (xf86Info.pKeyboard) + if (xf86Info.kbdProc && xf86Info.pKeyboard) (xf86Info.kbdProc)(xf86Info.pKeyboard, DEVICE_CLOSE); /* @@ -1254,6 +1255,10 @@ /* Need the sleep when starting X from within another X session */ sleep(1); #endif +#ifdef DPMSExtension /* Turn screens back on */ + if (DPMSPowerLevel != DPMSModeOn) + DPMSSet(DPMSModeOn); +#endif if (xf86Screens) { if (xf86Screens[0]->vtSema) xf86EnterServerState(SETUP); @@ -1265,10 +1270,6 @@ * screen explicitely. */ xf86EnableAccess(xf86Screens[i]); -#ifdef DPMSExtension - if (xf86Screens[i]->DPMSSet) - xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0); -#endif (xf86Screens[i]->LeaveVT)(i, 0); } }