xf86Events: split xf86VTSwitch into xf86VTLeave and xf86VTEnter functions

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Hans de Goede 2013-12-19 11:26:36 +01:00 committed by Keith Packard
parent 33cec8af55
commit 78f0667d6d
2 changed files with 169 additions and 154 deletions

View File

@ -234,6 +234,8 @@ extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
extern _X_EXPORT void xf86PrintBacktrace(void);
extern _X_EXPORT Bool xf86VTOwner(void);
extern _X_EXPORT void xf86VTLeave(void);
extern _X_EXPORT void xf86VTEnter(void);
/* xf86Helper.c */

View File

@ -407,30 +407,13 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
}
}
/*
* xf86VTSwitch --
* Handle requests for switching the vt.
*/
static void
xf86VTSwitch(void)
void
xf86VTLeave(void)
{
int i;
InputInfoPtr pInfo;
IHPtr ih;
DebugF("xf86VTSwitch()\n");
#ifdef XFreeXDGA
if (!DGAVTSwitch())
return;
#endif
/*
* Since all screens are currently all in the same state it is sufficient
* check the first. This might change in future.
*/
if (xf86VTOwner()) {
DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
#ifdef DPMSExtension
@ -527,8 +510,15 @@ xf86VTSwitch(void)
if (xorgHWAccess)
xf86DisableIO();
}
}
else {
}
void
xf86VTEnter(void)
{
int i;
InputInfoPtr pInfo;
IHPtr ih;
DebugF("xf86VTSwitch: Entering\n");
if (!xf86VTSwitchTo())
return;
@ -578,7 +568,30 @@ xf86VTSwitch(void)
#endif
OsReleaseSIGIO();
}
}
/*
* xf86VTSwitch --
* Handle requests for switching the vt.
*/
static void
xf86VTSwitch(void)
{
DebugF("xf86VTSwitch()\n");
#ifdef XFreeXDGA
if (!DGAVTSwitch())
return;
#endif
/*
* Since all screens are currently all in the same state it is sufficient
* check the first. This might change in future.
*/
if (xf86VTOwner())
xf86VTLeave();
else
xf86VTEnter();
}
/* Input handler registration */