summaryrefslogtreecommitdiff
path: root/glx/glxdri.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-07-12 16:01:34 -0700
committerKeith Packard <keithp@keithp.com>2010-07-13 09:58:04 -0700
commitd75e8146c414bfd512ba5dbd4a83acb334bbe19b (patch)
treeb870671a16ef432871a1391207c287fee1ceae01 /glx/glxdri.c
parent3209b094a3b1466b579e8020e12a4f3fa78a5f3f (diff)
Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998
Because some EnterVT code needs to remove it self from the call chain, we need to fix all of the wrappers to correctly unwrap/rewrap during the call chain. This is a follow-on to the fix for bug 27114 in commit 68a9ee8370e6f9b38218376ac92d5130a5b0ef1e. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Jesse Barnes <jesse.barnes@intel.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Diffstat (limited to 'glx/glxdri.c')
-rw-r--r--glx/glxdri.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/glx/glxdri.c b/glx/glxdri.c
index 32b35db4c..41482c913 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -866,12 +866,21 @@ static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
glxDRIEnterVT (int index, int flags)
{
+ ScrnInfoPtr scrn = xf86Screens[index];
+ Bool ret;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
- if (!(*screen->enterVT) (index, flags))
+ scrn->EnterVT = screen->enterVT;
+
+ ret = scrn->EnterVT (index, flags);
+
+ screen->enterVT = scrn->EnterVT;
+ scrn->EnterVT = glxDRIEnterVT;
+
+ if (!ret)
return FALSE;
glxResumeClients();
@@ -882,6 +891,7 @@ glxDRIEnterVT (int index, int flags)
static void
glxDRILeaveVT (int index, int flags)
{
+ ScrnInfoPtr scrn = xf86Screens[index];
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
@@ -889,7 +899,10 @@ glxDRILeaveVT (int index, int flags)
glxSuspendClients();
- return (*screen->leaveVT) (index, flags);
+ scrn->LeaveVT = screen->leaveVT;
+ (*screen->leaveVT) (index, flags);
+ screen->leaveVT = scrn->LeaveVT;
+ scrn->LeaveVT = glxDRILeaveVT;
}
static void