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 <dh.herrmann@googlemail.com>
This commit is contained in:
parent
e18e063d87
commit
a0217124e5
@ -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,
|
static void input_event(struct uterm_input *input,
|
||||||
struct uterm_input_event *ev,
|
struct uterm_input_event *ev,
|
||||||
void *data)
|
void *data)
|
||||||
@ -310,13 +300,9 @@ int kmscon_terminal_new(struct kmscon_terminal **out,
|
|||||||
goto err_pty;
|
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);
|
ret = uterm_input_register_cb(term->input, input_event, term);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_video;
|
goto err_shader;
|
||||||
|
|
||||||
ev_eloop_ref(term->eloop);
|
ev_eloop_ref(term->eloop);
|
||||||
uterm_video_ref(term->video);
|
uterm_video_ref(term->video);
|
||||||
@ -326,8 +312,6 @@ int kmscon_terminal_new(struct kmscon_terminal **out,
|
|||||||
log_debug("new terminal object %p", term);
|
log_debug("new terminal object %p", term);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_video:
|
|
||||||
uterm_video_unregister_cb(term->video, video_event, term);
|
|
||||||
err_shader:
|
err_shader:
|
||||||
gl_shader_unref(term->shader);
|
gl_shader_unref(term->shader);
|
||||||
err_pty:
|
err_pty:
|
||||||
@ -361,7 +345,6 @@ void kmscon_terminal_unref(struct kmscon_terminal *term)
|
|||||||
kmscon_terminal_close(term);
|
kmscon_terminal_close(term);
|
||||||
rm_all_screens(term);
|
rm_all_screens(term);
|
||||||
uterm_input_unregister_cb(term->input, input_event, term);
|
uterm_input_unregister_cb(term->input, input_event, term);
|
||||||
uterm_video_unregister_cb(term->video, video_event, term);
|
|
||||||
gl_shader_unref(term->shader);
|
gl_shader_unref(term->shader);
|
||||||
kmscon_pty_unref(term->pty);
|
kmscon_pty_unref(term->pty);
|
||||||
kmscon_vte_unref(term->vte);
|
kmscon_vte_unref(term->vte);
|
||||||
|
1
src/ui.c
1
src/ui.c
@ -93,6 +93,7 @@ static void video_event(struct uterm_video *video,
|
|||||||
while (disp) {
|
while (disp) {
|
||||||
video_activate(vid, disp);
|
video_activate(vid, disp);
|
||||||
kmscon_terminal_add_display(ui->term, disp);
|
kmscon_terminal_add_display(ui->term, disp);
|
||||||
|
kmscon_terminal_redraw(ui->term);
|
||||||
disp = uterm_display_next(disp);
|
disp = uterm_display_next(disp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user