summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-01-19 12:27:28 -0500
committerChris Michael <cp.michael@samsung.com>2015-01-19 12:48:41 -0500
commitd38462f2ebdcbb928fb459fc0ac9db0a07bce31a (patch)
tree2d4da9e9d2cf8cb25987e83b1318a5119dd60183 /src/lib/ecore_drm
parent862e17140d1947fc704142a1b3e1b8dc6179edf9 (diff)
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>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_tty.c b/src/lib/ecore_drm/ecore_drm_tty.c
index 0a0c51c063..fe338f52fa 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -12,6 +12,8 @@
12# define KDSKBMUTE 0x4B51 12# define KDSKBMUTE 0x4B51
13#endif 13#endif
14 14
15static int kbd_mode = 0;
16
15Eina_Bool 17Eina_Bool
16_ecore_drm_tty_switch(Ecore_Drm_Device *dev, int activate_vt) 18_ecore_drm_tty_switch(Ecore_Drm_Device *dev, int activate_vt)
17{ 19{
@@ -51,6 +53,12 @@ _ecore_drm_tty_setup(Ecore_Drm_Device *dev)
51 return EINA_FALSE; 53 return EINA_FALSE;
52 } 54 }
53 55
56 if (ioctl(dev->tty.fd, KDGKBMODE, &kbd_mode))
57 {
58 ERR("Could not get curent kbd mode: %m");
59 return EINA_FALSE;
60 }
61
54 if (ioctl(dev->tty.fd, KDSKBMUTE, 1) && 62 if (ioctl(dev->tty.fd, KDSKBMUTE, 1) &&
55 ioctl(dev->tty.fd, KDSKBMODE, K_OFF)) 63 ioctl(dev->tty.fd, KDSKBMODE, K_OFF))
56 { 64 {
@@ -171,6 +179,12 @@ _ecore_drm_tty_restore(Ecore_Drm_Device *dev)
171 if (ioctl(fd, KDSETMODE, KD_TEXT)) 179 if (ioctl(fd, KDSETMODE, KD_TEXT))
172 ERR("Could not set KD_TEXT mode on tty: %m\n"); 180 ERR("Could not set KD_TEXT mode on tty: %m\n");
173 181
182 if (ioctl(dev->tty.fd, KDSKBMUTE, 0) &&
183 ioctl(dev->tty.fd, KDSKBMODE, kbd_mode))
184 {
185 ERR("Could not restore keyboard mode: %m");
186 }
187
174 ecore_drm_device_master_drop(dev); 188 ecore_drm_device_master_drop(dev);
175 189
176 mode.mode = VT_AUTO; 190 mode.mode = VT_AUTO;