devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d38462f2ebdcbb928fb459fc0ac9db0a07bce31a

commit d38462f2ebdcbb928fb459fc0ac9db0a07bce31a
Author: Chris Michael <[email protected]>
Date:   Mon Jan 19 12:27:28 2015 -0500

    ecore-drm: Restore tty keyboard mode on restore of tty
    
    Summary: When we are shutting down a tty, restore the old keyboard
    mode that we retain from tty_setup.
    
    @fix
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_drm/ecore_drm_tty.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/lib/ecore_drm/ecore_drm_tty.c 
b/src/lib/ecore_drm/ecore_drm_tty.c
index 0a0c51c..fe338f5 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -12,6 +12,8 @@
 # define KDSKBMUTE 0x4B51
 #endif
 
+static int kbd_mode = 0;
+
 Eina_Bool
 _ecore_drm_tty_switch(Ecore_Drm_Device *dev, int activate_vt)
 {
@@ -51,6 +53,12 @@ _ecore_drm_tty_setup(Ecore_Drm_Device *dev)
         return EINA_FALSE;
      }
 
+   if (ioctl(dev->tty.fd, KDGKBMODE, &kbd_mode))
+     {
+        ERR("Could not get curent kbd mode: %m");
+        return EINA_FALSE;
+     }
+
    if (ioctl(dev->tty.fd, KDSKBMUTE, 1) && 
        ioctl(dev->tty.fd, KDSKBMODE, K_OFF))
      {
@@ -171,6 +179,12 @@ _ecore_drm_tty_restore(Ecore_Drm_Device *dev)
    if (ioctl(fd, KDSETMODE, KD_TEXT))
      ERR("Could not set KD_TEXT mode on tty: %m\n");
 
+   if (ioctl(dev->tty.fd, KDSKBMUTE, 0) && 
+       ioctl(dev->tty.fd, KDSKBMODE, kbd_mode))
+     {
+        ERR("Could not restore keyboard mode: %m");
+     }
+
    ecore_drm_device_master_drop(dev);
 
    mode.mode = VT_AUTO;

-- 


Reply via email to