terminal: pass seat-name to PTY
This passes the current seat-name from kmscon_app through ui and terminal into kmscon_pty. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
593a4992b4
commit
1356e72f9b
@ -170,7 +170,7 @@ static void seat_new(struct kmscon_app *app,
|
||||
if (ret)
|
||||
goto err_input;
|
||||
|
||||
ret = kmscon_ui_new(&seat->ui, app->eloop, seat->input);
|
||||
ret = kmscon_ui_new(&seat->ui, app->eloop, seat->input, seat->sname);
|
||||
if (ret)
|
||||
goto err_vt;
|
||||
|
||||
|
@ -400,7 +400,8 @@ static void write_event(struct tsm_vte *vte, const char *u8, size_t len,
|
||||
|
||||
int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||
struct ev_eloop *loop,
|
||||
struct uterm_input *input)
|
||||
struct uterm_input *input,
|
||||
const char *seat)
|
||||
{
|
||||
struct kmscon_terminal *term;
|
||||
int ret;
|
||||
@ -459,6 +460,10 @@ int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||
if (ret)
|
||||
goto err_pty;
|
||||
|
||||
ret = kmscon_pty_set_seat(term->pty, seat);
|
||||
if (ret)
|
||||
goto err_pty;
|
||||
|
||||
ret = ev_eloop_new_fd(term->eloop, &term->ptyfd,
|
||||
kmscon_pty_get_fd(term->pty),
|
||||
EV_READABLE, pty_event, term);
|
||||
|
@ -52,7 +52,8 @@ typedef void (*kmscon_terminal_event_cb)
|
||||
|
||||
int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||
struct ev_eloop *loop,
|
||||
struct uterm_input *input);
|
||||
struct uterm_input *input,
|
||||
const char *seat);
|
||||
void kmscon_terminal_ref(struct kmscon_terminal *term);
|
||||
void kmscon_terminal_unref(struct kmscon_terminal *term);
|
||||
|
||||
|
5
src/ui.c
5
src/ui.c
@ -184,7 +184,8 @@ static void terminal_event(struct kmscon_terminal *term,
|
||||
|
||||
int kmscon_ui_new(struct kmscon_ui **out,
|
||||
struct ev_eloop *eloop,
|
||||
struct uterm_input *input)
|
||||
struct uterm_input *input,
|
||||
const char *seat)
|
||||
{
|
||||
struct kmscon_ui *ui;
|
||||
int ret;
|
||||
@ -200,7 +201,7 @@ int kmscon_ui_new(struct kmscon_ui **out,
|
||||
ui->input = input;
|
||||
shl_dlist_init(&ui->video_list);
|
||||
|
||||
ret = kmscon_terminal_new(&ui->term, eloop, ui->input);
|
||||
ret = kmscon_terminal_new(&ui->term, eloop, ui->input, seat);
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
|
3
src/ui.h
3
src/ui.h
@ -41,7 +41,8 @@ struct kmscon_ui;
|
||||
|
||||
int kmscon_ui_new(struct kmscon_ui **out,
|
||||
struct ev_eloop *eloop,
|
||||
struct uterm_input *input);
|
||||
struct uterm_input *input,
|
||||
const char *seat);
|
||||
void kmscon_ui_free(struct kmscon_ui *ui);
|
||||
void kmscon_ui_add_video(struct kmscon_ui *ui, struct uterm_video *video);
|
||||
void kmscon_ui_remove_video(struct kmscon_ui *ui, struct uterm_video *video);
|
||||
|
Loading…
x
Reference in New Issue
Block a user