2012-05-22 00:48:05 +04:00
|
|
|
/*
|
|
|
|
* Copyright © 2011 Intel Corporation
|
|
|
|
*
|
2015-06-12 02:22:34 +03:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
* a copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
2012-05-22 00:48:05 +04:00
|
|
|
*
|
2015-06-12 02:22:34 +03:00
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial
|
|
|
|
* portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
|
|
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
2012-05-22 00:48:05 +04:00
|
|
|
*/
|
|
|
|
|
2013-05-22 19:03:19 +04:00
|
|
|
#include "config.h"
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/un.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
#include "xwayland.h"
|
2015-06-16 01:37:10 +03:00
|
|
|
#include "shared/helpers.h"
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
|
2014-03-18 09:33:29 +04:00
|
|
|
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.*/
|
2014-06-19 12:03:31 +04:00
|
|
|
wxs->wm = weston_wm_create(wxs, wxs->wm_fd);
|
2014-03-18 09:33:29 +04:00
|
|
|
wl_event_source_remove(wxs->sigusr1_source);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-05-22 00:48:05 +04:00
|
|
|
static int
|
|
|
|
weston_xserver_handle_event(int listen_fd, uint32_t mask, void *data)
|
|
|
|
{
|
2012-11-30 23:19:56 +04:00
|
|
|
struct weston_xserver *wxs = data;
|
2014-03-18 09:33:29 +04:00
|
|
|
char display[8], s[8], abstract_fd[8], unix_fd[8], wm_fd[8];
|
|
|
|
int sv[2], wm[2], fd;
|
2013-08-14 23:33:10 +04:00
|
|
|
char *xserver = NULL;
|
|
|
|
struct weston_config_section *section;
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sv) < 0) {
|
2014-03-18 09:33:29 +04:00
|
|
|
weston_log("wl connection socketpair failed\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, wm) < 0) {
|
|
|
|
weston_log("X wm connection socketpair failed\n");
|
2012-05-22 00:48:05 +04:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->process.pid = fork();
|
|
|
|
switch (wxs->process.pid) {
|
2012-05-22 00:48:05 +04:00
|
|
|
case 0:
|
|
|
|
/* SOCK_CLOEXEC closes both ends, so we need to unset
|
|
|
|
* the flag on the client fd. */
|
2014-03-18 09:33:29 +04:00
|
|
|
fd = dup(sv[1]);
|
|
|
|
if (fd < 0)
|
|
|
|
goto fail;
|
|
|
|
snprintf(s, sizeof s, "%d", fd);
|
2012-05-22 00:48:05 +04:00
|
|
|
setenv("WAYLAND_SOCKET", s, 1);
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
snprintf(display, sizeof display, ":%d", wxs->display);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2014-03-18 09:33:29 +04:00
|
|
|
fd = dup(wxs->abstract_fd);
|
|
|
|
if (fd < 0)
|
|
|
|
goto fail;
|
|
|
|
snprintf(abstract_fd, sizeof abstract_fd, "%d", fd);
|
|
|
|
fd = dup(wxs->unix_fd);
|
|
|
|
if (fd < 0)
|
|
|
|
goto fail;
|
|
|
|
snprintf(unix_fd, sizeof unix_fd, "%d", fd);
|
|
|
|
fd = dup(wm[1]);
|
|
|
|
if (fd < 0)
|
|
|
|
goto fail;
|
|
|
|
snprintf(wm_fd, sizeof wm_fd, "%d", fd);
|
|
|
|
|
|
|
|
section = weston_config_get_section(wxs->compositor->config,
|
|
|
|
"xwayland", NULL, NULL);
|
|
|
|
weston_config_section_get_string(section, "path",
|
|
|
|
&xserver, XSERVER_PATH);
|
|
|
|
|
|
|
|
/* Ignore SIGUSR1 in the child, which will make the X
|
|
|
|
* server send SIGUSR1 to the parent (weston) when
|
|
|
|
* it's done with initialization. During
|
|
|
|
* initialization the X server will round trip and
|
|
|
|
* block on the wayland compositor, so avoid making
|
|
|
|
* blocking requests (like xcb_connect_to_fd) until
|
|
|
|
* it's done with that. */
|
|
|
|
signal(SIGUSR1, SIG_IGN);
|
2013-08-14 23:33:10 +04:00
|
|
|
|
|
|
|
if (execl(xserver,
|
|
|
|
xserver,
|
2012-05-22 00:48:05 +04:00
|
|
|
display,
|
|
|
|
"-rootless",
|
2014-03-18 09:33:29 +04:00
|
|
|
"-listen", abstract_fd,
|
|
|
|
"-listen", unix_fd,
|
|
|
|
"-wm", wm_fd,
|
2012-05-22 00:48:05 +04:00
|
|
|
"-terminate",
|
|
|
|
NULL) < 0)
|
2014-06-20 23:36:54 +04:00
|
|
|
weston_log("exec of '%s %s -rootless "
|
|
|
|
"-listen %s -listen %s -wm %s "
|
|
|
|
"-terminate' failed: %m\n",
|
|
|
|
xserver, display,
|
|
|
|
abstract_fd, unix_fd, wm_fd);
|
2014-03-18 09:33:29 +04:00
|
|
|
fail:
|
2013-06-18 09:03:02 +04:00
|
|
|
_exit(EXIT_FAILURE);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
default:
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_log("forked X server, pid %d\n", wxs->process.pid);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
close(sv[1]);
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->client = wl_client_create(wxs->wl_display, sv[0]);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2014-03-18 09:33:29 +04:00
|
|
|
close(wm[1]);
|
|
|
|
wxs->wm_fd = wm[0];
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_watch_process(&wxs->process);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wl_event_source_remove(wxs->abstract_source);
|
|
|
|
wl_event_source_remove(wxs->unix_source);
|
2012-05-22 00:48:05 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case -1:
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log( "failed to fork\n");
|
2012-05-22 00:48:05 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
weston_xserver_shutdown(struct weston_xserver *wxs)
|
|
|
|
{
|
|
|
|
char path[256];
|
|
|
|
|
|
|
|
snprintf(path, sizeof path, "/tmp/.X%d-lock", wxs->display);
|
|
|
|
unlink(path);
|
|
|
|
snprintf(path, sizeof path, "/tmp/.X11-unix/X%d", wxs->display);
|
|
|
|
unlink(path);
|
|
|
|
if (wxs->process.pid == 0) {
|
|
|
|
wl_event_source_remove(wxs->abstract_source);
|
|
|
|
wl_event_source_remove(wxs->unix_source);
|
|
|
|
}
|
|
|
|
close(wxs->abstract_fd);
|
|
|
|
close(wxs->unix_fd);
|
2014-06-19 12:03:31 +04:00
|
|
|
if (wxs->wm) {
|
2012-05-22 00:48:05 +04:00
|
|
|
weston_wm_destroy(wxs->wm);
|
2014-06-19 12:03:31 +04:00
|
|
|
wxs->wm = NULL;
|
|
|
|
}
|
2012-05-22 00:48:05 +04:00
|
|
|
wxs->loop = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
weston_xserver_cleanup(struct weston_process *process, int status)
|
|
|
|
{
|
2012-11-30 23:19:56 +04:00
|
|
|
struct weston_xserver *wxs =
|
2012-05-22 00:48:05 +04:00
|
|
|
container_of(process, struct weston_xserver, process);
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->process.pid = 0;
|
|
|
|
wxs->client = NULL;
|
|
|
|
wxs->resource = NULL;
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->abstract_source =
|
|
|
|
wl_event_loop_add_fd(wxs->loop, wxs->abstract_fd,
|
2012-05-22 00:48:05 +04:00
|
|
|
WL_EVENT_READABLE,
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_xserver_handle_event, wxs);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->unix_source =
|
|
|
|
wl_event_loop_add_fd(wxs->loop, wxs->unix_fd,
|
2012-05-22 00:48:05 +04:00
|
|
|
WL_EVENT_READABLE,
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_xserver_handle_event, wxs);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
if (wxs->wm) {
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("xserver exited, code %d\n", status);
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_wm_destroy(wxs->wm);
|
|
|
|
wxs->wm = NULL;
|
2012-05-22 00:48:05 +04:00
|
|
|
} else {
|
|
|
|
/* If the X server crashes before it binds to the
|
|
|
|
* xserver interface, shut down and don't try
|
|
|
|
* again. */
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("xserver crashing too fast: %d\n", status);
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_xserver_shutdown(wxs);
|
2012-05-22 00:48:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
bind_to_abstract_socket(int display)
|
|
|
|
{
|
|
|
|
struct sockaddr_un addr;
|
|
|
|
socklen_t size, name_size;
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
fd = socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
addr.sun_family = AF_LOCAL;
|
|
|
|
name_size = snprintf(addr.sun_path, sizeof addr.sun_path,
|
|
|
|
"%c/tmp/.X11-unix/X%d", 0, display);
|
|
|
|
size = offsetof(struct sockaddr_un, sun_path) + name_size;
|
|
|
|
if (bind(fd, (struct sockaddr *) &addr, size) < 0) {
|
2014-04-02 03:55:26 +04:00
|
|
|
weston_log("failed to bind to @%s: %m\n", addr.sun_path + 1);
|
2012-05-22 00:48:05 +04:00
|
|
|
close(fd);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listen(fd, 1) < 0) {
|
|
|
|
close(fd);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return fd;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
bind_to_unix_socket(int display)
|
|
|
|
{
|
|
|
|
struct sockaddr_un addr;
|
|
|
|
socklen_t size, name_size;
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
fd = socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
addr.sun_family = AF_LOCAL;
|
|
|
|
name_size = snprintf(addr.sun_path, sizeof addr.sun_path,
|
|
|
|
"/tmp/.X11-unix/X%d", display) + 1;
|
|
|
|
size = offsetof(struct sockaddr_un, sun_path) + name_size;
|
|
|
|
unlink(addr.sun_path);
|
|
|
|
if (bind(fd, (struct sockaddr *) &addr, size) < 0) {
|
2014-04-02 03:55:26 +04:00
|
|
|
weston_log("failed to bind to %s: %m\n", addr.sun_path);
|
2012-05-22 00:48:05 +04:00
|
|
|
close(fd);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listen(fd, 1) < 0) {
|
|
|
|
unlink(addr.sun_path);
|
|
|
|
close(fd);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return fd;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
create_lockfile(int display, char *lockfile, size_t lsize)
|
|
|
|
{
|
|
|
|
char pid[16], *end;
|
|
|
|
int fd, size;
|
|
|
|
pid_t other;
|
|
|
|
|
|
|
|
snprintf(lockfile, lsize, "/tmp/.X%d-lock", display);
|
|
|
|
fd = open(lockfile, O_WRONLY | O_CLOEXEC | O_CREAT | O_EXCL, 0444);
|
|
|
|
if (fd < 0 && errno == EEXIST) {
|
2014-02-02 08:44:54 +04:00
|
|
|
fd = open(lockfile, O_CLOEXEC | O_RDONLY);
|
2012-05-22 00:48:05 +04:00
|
|
|
if (fd < 0 || read(fd, pid, 11) != 11) {
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("can't read lock file %s: %s\n",
|
2012-05-22 00:48:05 +04:00
|
|
|
lockfile, strerror(errno));
|
2012-12-05 22:47:07 +04:00
|
|
|
if (fd >= 0)
|
|
|
|
close (fd);
|
|
|
|
|
2012-05-22 00:48:05 +04:00
|
|
|
errno = EEXIST;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
other = strtol(pid, &end, 0);
|
|
|
|
if (end != pid + 10) {
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("can't parse lock file %s\n",
|
2012-05-22 00:48:05 +04:00
|
|
|
lockfile);
|
|
|
|
close(fd);
|
|
|
|
errno = EEXIST;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (kill(other, 0) < 0 && errno == ESRCH) {
|
|
|
|
/* stale lock file; unlink and try again */
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("unlinking stale lock file %s\n", lockfile);
|
2012-05-22 00:48:05 +04:00
|
|
|
close(fd);
|
|
|
|
if (unlink(lockfile))
|
|
|
|
/* If we fail to unlink, return EEXIST
|
|
|
|
so we try the next display number.*/
|
|
|
|
errno = EEXIST;
|
|
|
|
else
|
|
|
|
errno = EAGAIN;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2012-07-08 05:03:45 +04:00
|
|
|
close(fd);
|
2012-05-22 00:48:05 +04:00
|
|
|
errno = EEXIST;
|
|
|
|
return -1;
|
|
|
|
} else if (fd < 0) {
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("failed to create lock file %s: %s\n",
|
2012-05-22 00:48:05 +04:00
|
|
|
lockfile, strerror(errno));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Subtle detail: we use the pid of the wayland
|
|
|
|
* compositor, not the xserver in the lock file. */
|
|
|
|
size = snprintf(pid, sizeof pid, "%10d\n", getpid());
|
|
|
|
if (write(fd, pid, size) != size) {
|
|
|
|
unlink(lockfile);
|
|
|
|
close(fd);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
weston_xserver_destroy(struct wl_listener *l, void *data)
|
|
|
|
{
|
|
|
|
struct weston_xserver *wxs =
|
|
|
|
container_of(l, struct weston_xserver, destroy_listener);
|
|
|
|
|
|
|
|
if (!wxs)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (wxs->loop)
|
|
|
|
weston_xserver_shutdown(wxs);
|
|
|
|
|
|
|
|
free(wxs);
|
|
|
|
}
|
|
|
|
|
|
|
|
WL_EXPORT int
|
2013-02-21 00:37:49 +04:00
|
|
|
module_init(struct weston_compositor *compositor,
|
2013-05-14 20:48:26 +04:00
|
|
|
int *argc, char *argv[])
|
2013-02-21 00:37:49 +04:00
|
|
|
|
2012-05-22 00:48:05 +04:00
|
|
|
{
|
|
|
|
struct wl_display *display = compositor->wl_display;
|
2012-11-30 23:19:56 +04:00
|
|
|
struct weston_xserver *wxs;
|
2012-05-22 00:48:05 +04:00
|
|
|
char lockfile[256], display_name[8];
|
|
|
|
|
2013-08-08 05:57:05 +04:00
|
|
|
wxs = zalloc(sizeof *wxs);
|
2014-04-22 03:51:03 +04:00
|
|
|
if (wxs == NULL)
|
|
|
|
return -1;
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->process.cleanup = weston_xserver_cleanup;
|
|
|
|
wxs->wl_display = display;
|
|
|
|
wxs->compositor = compositor;
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->display = 0;
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
retry:
|
2012-11-30 23:19:56 +04:00
|
|
|
if (create_lockfile(wxs->display, lockfile, sizeof lockfile) < 0) {
|
2012-05-22 00:48:05 +04:00
|
|
|
if (errno == EAGAIN) {
|
|
|
|
goto retry;
|
|
|
|
} else if (errno == EEXIST) {
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->display++;
|
2012-05-22 00:48:05 +04:00
|
|
|
goto retry;
|
|
|
|
} else {
|
2012-11-30 23:19:56 +04:00
|
|
|
free(wxs);
|
2012-05-22 00:48:05 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->abstract_fd = bind_to_abstract_socket(wxs->display);
|
|
|
|
if (wxs->abstract_fd < 0 && errno == EADDRINUSE) {
|
|
|
|
wxs->display++;
|
2012-05-22 00:48:05 +04:00
|
|
|
unlink(lockfile);
|
|
|
|
goto retry;
|
|
|
|
}
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->unix_fd = bind_to_unix_socket(wxs->display);
|
|
|
|
if (wxs->unix_fd < 0) {
|
2012-05-22 00:48:05 +04:00
|
|
|
unlink(lockfile);
|
2012-11-30 23:19:56 +04:00
|
|
|
close(wxs->abstract_fd);
|
|
|
|
free(wxs);
|
2012-05-22 00:48:05 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
snprintf(display_name, sizeof display_name, ":%d", wxs->display);
|
2012-06-07 20:01:59 +04:00
|
|
|
weston_log("xserver listening on display %s\n", display_name);
|
2012-05-22 00:48:05 +04:00
|
|
|
setenv("DISPLAY", display_name, 1);
|
|
|
|
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->loop = wl_display_get_event_loop(display);
|
|
|
|
wxs->abstract_source =
|
|
|
|
wl_event_loop_add_fd(wxs->loop, wxs->abstract_fd,
|
2012-05-22 00:48:05 +04:00
|
|
|
WL_EVENT_READABLE,
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_xserver_handle_event, wxs);
|
|
|
|
wxs->unix_source =
|
|
|
|
wl_event_loop_add_fd(wxs->loop, wxs->unix_fd,
|
2012-05-22 00:48:05 +04:00
|
|
|
WL_EVENT_READABLE,
|
2012-11-30 23:19:56 +04:00
|
|
|
weston_xserver_handle_event, wxs);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
2014-03-18 09:33:29 +04:00
|
|
|
wxs->sigusr1_source = wl_event_loop_add_signal(wxs->loop, SIGUSR1,
|
|
|
|
handle_sigusr1, wxs);
|
2012-11-30 23:19:56 +04:00
|
|
|
wxs->destroy_listener.notify = weston_xserver_destroy;
|
|
|
|
wl_signal_add(&compositor->destroy_signal, &wxs->destroy_listener);
|
2012-05-22 00:48:05 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|