diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-27 14:33:25 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-27 14:33:25 +0100 |
commit | cf6e8218bab44447c6916dfd924e41de30beb8cb (patch) | |
tree | 0efa8d0bc234fe119b1b9141c84398ef039f6f83 /fbcon.c | |
parent | 59ca05ee1a59c5298767cf9563ef7f92ec895936 (diff) | |
download | fbida-cf6e8218bab44447c6916dfd924e41de30beb8cb.tar.gz |
more logind console switching
Diffstat (limited to 'fbcon.c')
-rw-r--r-- | fbcon.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -47,6 +47,7 @@ static int font_size = 16; static bool verbose; static gfxstate *gfx; +static bool active; static cairo_font_extents_t extents; static struct cairo_state { cairo_surface_t *surface; @@ -178,15 +179,18 @@ static void cleanup_and_exit(int code) static void console_switch_suspend(void) { + gfx->suspend_display(); libinput_suspend(kbd); logind_release_control(); + active = false; } static void console_switch_resume(void) { - gfx->restore_display(); + active = true; logind_take_control(); libinput_resume(kbd); + gfx->resume_display(); state1.clear++; state2.clear++; dirty++; @@ -643,10 +647,13 @@ int main(int argc, char *argv[]) exit(1); exit_signals_init(); signal(SIGTSTP,SIG_IGN); +#if 0 if (console_switch_init(console_switch_suspend, console_switch_resume) < 0) { fprintf(stderr, "NOTICE: No vt switching available on terminal.\n"); } +#endif + active = true; /* init cairo */ state1.surface = cairo_image_surface_create_for_data(gfx->mem, @@ -710,7 +717,7 @@ int main(int argc, char *argv[]) fd_set set; int rc, max; - if (dirty) { + if (active && dirty) { fbcon_tsm_render(); dirty = 0; } |