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 <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-01-19 12:27:28 -05:00
parent 862e17140d
commit d38462f2eb
1 changed files with 14 additions and 0 deletions

View File

@ -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;