aboutsummaryrefslogtreecommitdiffstats
path: root/fbcon.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-03-27 14:33:25 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-27 14:33:25 +0100
commitcf6e8218bab44447c6916dfd924e41de30beb8cb (patch)
tree0efa8d0bc234fe119b1b9141c84398ef039f6f83 /fbcon.c
parent59ca05ee1a59c5298767cf9563ef7f92ec895936 (diff)
downloadfbida-cf6e8218bab44447c6916dfd924e41de30beb8cb.tar.gz
more logind console switching
Diffstat (limited to 'fbcon.c')
-rw-r--r--fbcon.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fbcon.c b/fbcon.c
index 489191a..2f0f2bc 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -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;
}