5860bf4
From 492bfcdc7419a94bd026202b2a2c65541c2e54d2 Mon Sep 17 00:00:00 2001
5860bf4
From: Adam Jackson <ajax@redhat.com>
5860bf4
Date: Fri, 8 May 2009 16:06:23 -0400
5860bf4
Subject: [PATCH] Fake key releases on vt leave, not just enter
5860bf4
5860bf4
Fixes silly cpu usage bug while vt switched away.
5860bf4
5860bf4
---
5860bf4
 hw/xfree86/common/xf86Events.c |    6 +++++-
5860bf4
 1 files changed, 5 insertions(+), 1 deletions(-)
5860bf4
5860bf4
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
5860bf4
index d6ef93a..9923f84 100644
5860bf4
--- a/hw/xfree86/common/xf86Events.c
5860bf4
+++ b/hw/xfree86/common/xf86Events.c
5860bf4
@@ -505,10 +505,14 @@ xf86VTSwitch()
5860bf4
      */
5860bf4
     pInfo = xf86InputDevs;
5860bf4
     while (pInfo) {
5860bf4
-      if (pInfo->dev)
5860bf4
+      if (pInfo->dev) {
5860bf4
+	  xf86ReleaseKeys(pInfo->dev);
5860bf4
           DisableDevice(pInfo->dev);
5860bf4
+      }
5860bf4
       pInfo = pInfo->next;
5860bf4
     }
5860bf4
+    xf86ReleaseKeys(inputInfo.keyboard);
5860bf4
+
5860bf4
     xf86EnterServerState(SETUP);
5860bf4
     for (i = 0; i < xf86NumScreens; i++)
5860bf4
 	xf86Screens[i]->LeaveVT(i, 0);
5860bf4
-- 
5860bf4
1.6.2.2
5860bf4