diff options
-rw-r--r-- | fbi.c | 11 | ||||
-rw-r--r-- | fbpdf.c | 11 | ||||
-rw-r--r-- | vt.c | 19 | ||||
-rw-r--r-- | vt.h | 3 |
4 files changed, 30 insertions, 14 deletions
@@ -1314,11 +1314,17 @@ static void cleanup_and_exit(int code) exit(code); } -static void console_switch_redraw(void) +static void console_switch_suspend(void) +{ + kbd_suspend(); +} + +static void console_switch_resume(void) { gfx->restore_display(); shadow_set_dirty(); shadow_render(gfx); + kbd_resume(); } int main(int argc, char *argv[]) @@ -1436,7 +1442,8 @@ int main(int argc, char *argv[]) } exit_signals_init(); signal(SIGTSTP,SIG_IGN); - if (console_switch_init(console_switch_redraw) < 0) { + if (console_switch_init(console_switch_suspend, + console_switch_resume) < 0) { fprintf(stderr, "NOTICE: No vt switching available on terminal.\n"); fprintf(stderr, "NOTICE: Not started from linux console? CONFIG_VT=n?\n"); if (framebuffer) { @@ -198,9 +198,15 @@ static void cleanup_and_exit(int code) exit(code); } -static void console_switch_redraw(void) +static void console_switch_suspend(void) +{ + kbd_suspend(); +} + +static void console_switch_resume(void) { gfx->restore_display(); + kbd_resume(); } static void @@ -319,7 +325,8 @@ int main(int argc, char *argv[]) } exit_signals_init(); signal(SIGTSTP,SIG_IGN); - if (console_switch_init(console_switch_redraw) < 0) { + if (console_switch_init(console_switch_suspend, + console_switch_resume) < 0) { fprintf(stderr, "NOTICE: No vt switching available on terminal.\n"); fprintf(stderr, "NOTICE: Not started from linux console? CONFIG_VT=n?\n"); if (framebuffer) { @@ -12,7 +12,6 @@ #include <linux/vt.h> #include "vt.h" -#include "kbd.h" /* -------------------------------------------------------------------- */ @@ -32,7 +31,8 @@ static int kd_mode; static struct vt_mode vt_mode; static struct vt_mode vt_omode; static int orig_vt_no = -1; -static void (*console_redraw)(void); +static void (*console_suspend)(void); +static void (*console_resume)(void); static void console_switch_signal(int signal) { @@ -66,11 +66,13 @@ static void console_switch_acquire(void) write(2,"vt: acquire\n",12); } -int console_switch_init(void (*redraw)(void)) +int console_switch_init(void (*suspend)(void), + void (*resume)(void)) { struct sigaction act,old; - console_redraw = redraw; + console_suspend = suspend; + console_resume = resume; memset(&act,0,sizeof(act)); act.sa_handler = console_switch_signal; @@ -129,17 +131,16 @@ int check_console_switch(void) switch (console_switch_state) { case CONSOLE_REL_REQ: - console_switch_release(); + console_visible = 0; + console_suspend(); + console_switch_release(); case CONSOLE_INACTIVE: - kbd_suspend(); - console_visible = 0; break; case CONSOLE_ACQ_REQ: console_switch_acquire(); case CONSOLE_ACTIVE: console_visible = 1; - console_redraw(); - kbd_resume(); + console_resume(); break; default: break; @@ -1,6 +1,7 @@ extern int console_visible; -int console_switch_init(void (*redraw)(void)); +int console_switch_init(void (*suspend)(void), + void (*resume)(void)); void console_switch_cleanup(void); int check_console_switch(void); |