From b0683874e98a2dab7cc73734355bb8e0ad656113 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Wed, 22 Nov 2017 08:10:06 -0500 Subject: xwm: send selection data --- rootston/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rootston/input.c') diff --git a/rootston/input.c b/rootston/input.c index ce20e840..94524b5f 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -27,7 +27,7 @@ static const char *device_type(enum wlr_input_device_type type) { return NULL; } -static struct roots_seat *input_get_seat(struct roots_input *input, char *name) { +struct roots_seat *input_get_seat(struct roots_input *input, char *name) { struct roots_seat *seat = NULL; wl_list_for_each(seat, &input->seats, link) { if (strcmp(seat->seat->name, name) == 0) { @@ -86,6 +86,7 @@ struct roots_input *input_create(struct roots_server *server, input->server = server; wl_list_init(&input->seats); + roots_seat_create(input, ROOTS_CONFIG_DEFAULT_SEAT_NAME); input->input_add.notify = input_add_notify; wl_signal_add(&server->backend->events.input_add, &input->input_add); -- cgit v1.2.3 From fc17c74516c7c843f15426bca754a16f963ad348 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Wed, 22 Nov 2017 08:23:23 -0500 Subject: xwayland: clean up seat setting --- include/wlr/xwayland.h | 1 + rootston/input.c | 1 - rootston/main.c | 16 +++------------- xwayland/xwayland.c | 10 +++++++++- 4 files changed, 13 insertions(+), 15 deletions(-) (limited to 'rootston/input.c') diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index cef17f38..351c6cd1 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -21,6 +21,7 @@ struct wlr_xwayland { struct wl_client *client; struct wl_display *wl_display; struct wlr_compositor *compositor; + struct wlr_seat *seat; time_t server_start; struct wl_event_source *sigusr1_source; diff --git a/rootston/input.c b/rootston/input.c index 94524b5f..a3904a61 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -86,7 +86,6 @@ struct roots_input *input_create(struct roots_server *server, input->server = server; wl_list_init(&input->seats); - roots_seat_create(input, ROOTS_CONFIG_DEFAULT_SEAT_NAME); input->input_add.notify = input_add_notify; wl_signal_add(&server->backend->events.input_add, &input->input_add); diff --git a/rootston/main.c b/rootston/main.c index 38bbec53..144da2c5 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -13,19 +13,6 @@ struct roots_server server = { 0 }; static void ready(struct wl_listener *listener, void *data) { - struct roots_desktop *desktop = - wl_container_of(listener, desktop, xwayland_ready); - -#ifdef HAS_XWAYLAND - struct wlr_xwayland *xwayland = data; - if (xwayland) { - struct roots_seat *seat = - input_get_seat(desktop->server->input, - ROOTS_CONFIG_DEFAULT_SEAT_NAME); - wlr_xwayland_set_seat(xwayland, seat->seat); - } -#endif - if (server.config->startup_cmd != NULL) { const char *cmd = server.config->startup_cmd; pid_t pid = fork(); @@ -72,6 +59,9 @@ int main(int argc, char **argv) { ready(NULL, NULL); #else if (server.desktop->xwayland != NULL) { + struct roots_seat *xwayland_seat = + input_get_seat(server.input, ROOTS_CONFIG_DEFAULT_SEAT_NAME); + wlr_xwayland_set_seat(server.desktop->xwayland, xwayland_seat->seat); wl_signal_add(&server.desktop->xwayland->events.ready, &server.desktop->xwayland_ready); server.desktop->xwayland_ready.notify = ready; diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index bd43fefb..4db30985 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -196,6 +196,10 @@ static int xserver_handle_ready(int signal_number, void *data) { return 1; } + if (wlr_xwayland->seat) { + xwm_set_seat(wlr_xwayland->xwm, wlr_xwayland->seat); + } + wl_event_source_remove(wlr_xwayland->sigusr1_source); wlr_xwayland->sigusr1_source = NULL; @@ -344,5 +348,9 @@ void wlr_xwayland_set_cursor(struct wlr_xwayland *wlr_xwayland, void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland, struct wlr_seat *seat) { - xwm_set_seat(xwayland->xwm, seat); + xwayland->seat = seat; + + if (xwayland->xwm) { + xwm_set_seat(xwayland->xwm, seat); + } } -- cgit v1.2.3