From a0217124e5563cfa666f976875e100a328bec62a Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sat, 21 Jul 2012 17:22:05 +0200 Subject: [PATCH] ui: dispatch redraws in UI instead of terminal We now schedule the terminal redraw from the UI to avoid having the terminal using uterm-video directly. Signed-off-by: David Herrmann --- src/terminal.c | 19 +------------------ src/ui.c | 1 + 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index 4fac37c..a06fd17 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -240,16 +240,6 @@ static void pty_input(struct kmscon_pty *pty, const char *u8, size_t len, } } -static void video_event(struct uterm_video *video, - struct uterm_video_hotplug *ev, - void *data) -{ - struct kmscon_terminal *term = data; - - if (ev->action == UTERM_WAKE_UP) - schedule_redraw(term); -} - static void input_event(struct uterm_input *input, struct uterm_input_event *ev, void *data) @@ -310,13 +300,9 @@ int kmscon_terminal_new(struct kmscon_terminal **out, goto err_pty; } - ret = uterm_video_register_cb(term->video, video_event, term); - if (ret) - goto err_shader; - ret = uterm_input_register_cb(term->input, input_event, term); if (ret) - goto err_video; + goto err_shader; ev_eloop_ref(term->eloop); uterm_video_ref(term->video); @@ -326,8 +312,6 @@ int kmscon_terminal_new(struct kmscon_terminal **out, log_debug("new terminal object %p", term); return 0; -err_video: - uterm_video_unregister_cb(term->video, video_event, term); err_shader: gl_shader_unref(term->shader); err_pty: @@ -361,7 +345,6 @@ void kmscon_terminal_unref(struct kmscon_terminal *term) kmscon_terminal_close(term); rm_all_screens(term); uterm_input_unregister_cb(term->input, input_event, term); - uterm_video_unregister_cb(term->video, video_event, term); gl_shader_unref(term->shader); kmscon_pty_unref(term->pty); kmscon_vte_unref(term->vte); diff --git a/src/ui.c b/src/ui.c index 50c2aa3..378e275 100644 --- a/src/ui.c +++ b/src/ui.c @@ -93,6 +93,7 @@ static void video_event(struct uterm_video *video, while (disp) { video_activate(vid, disp); kmscon_terminal_add_display(ui->term, disp); + kmscon_terminal_redraw(ui->term); disp = uterm_display_next(disp); } }