static int handle_sigusr1(int signal_number, void *data) { struct weston_xserver *wxs = data; /* We'd be safer if we actually had the struct * signalfd_siginfo from the signalfd data and could verify * this came from Xwayland.*/ wxs->wm = weston_wm_create(wxs, wxs->wm_fd); wl_event_source_remove(wxs->sigusr1_source); return 1; }
static void bind_xserver(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_xserver *wxs = data; /* If it's a different client than the xserver we launched, * don't start the wm. */ if (client != wxs->client) return; wxs->resource = wl_client_add_object(client, &xserver_interface, &xserver_implementation, id, wxs); wxs->wm = weston_wm_create(wxs); if (wxs->wm == NULL) { weston_log("failed to create wm\n"); } xserver_send_listen_socket(wxs->resource, wxs->abstract_fd); xserver_send_listen_socket(wxs->resource, wxs->unix_fd); }