summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-12-15 05:36:14 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-12-15 05:36:14 +0000
commitb6b4d6b3422167f05c1d9780a33b4ef95de1d475 (patch)
tree192b7856d5d870a26a78b9eeea3cdc6b09722700
parentb380853db92d5c16e53acd1d8bf744bced51359e (diff)
xc/programs/Xserver/hw/xfree86/common/xf86Events.c
//bugs.freedesktop.org/show_bug.cgi?id=1933) attachment #1392 (https://bugs.freedesktop.org/attachment.cgi?id=1392): Improving DPMS handling on VT swich and server termination/abort: previous version called the driver directly and too late. Patch by Egbert Eich <eich@freedesktop.org>
-rw-r--r--hw/xfree86/common/xf86Events.c14
-rw-r--r--hw/xfree86/common/xf86Init.c11
2 files changed, 13 insertions, 12 deletions
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 204bd9360..ff907a269 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -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 @@ xf86VTSwitch()
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 @@ xf86VTSwitch()
}
#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 */
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index f507753fe..d9d55a4fe 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -96,6 +96,7 @@ extern int xtest_command_key;
#ifdef DPMSExtension
#define DPMS_SERVER
#include "extensions/dpms.h"
+#include "dpmsproc.h"
#endif
@@ -1244,7 +1245,7 @@ AbortDDX()
/*
* try to deinitialize all input devices
*/
- if (xf86Info.pKeyboard)
+ if (xf86Info.kbdProc && xf86Info.pKeyboard)
(xf86Info.kbdProc)(xf86Info.pKeyboard, DEVICE_CLOSE);
/*
@@ -1254,6 +1255,10 @@ AbortDDX()
/* 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 @@ AbortDDX()
* screen explicitely.
*/
xf86EnableAccess(xf86Screens[i]);
-#ifdef DPMSExtension
- if (xf86Screens[i]->DPMSSet)
- xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
-#endif
(xf86Screens[i]->LeaveVT)(i, 0);
}
}