launcher: Move rest of tty object into struct weston_launcher

The struct weston_launcher object will now either handle tty and vt switching
details in-process (when running weston directly as root) or talk to
the weston-launch process.
parent 6a7c8492
...@@ -144,7 +144,6 @@ drm_backend_la_CFLAGS = \ ...@@ -144,7 +144,6 @@ drm_backend_la_CFLAGS = \
$(GCC_CFLAGS) $(GCC_CFLAGS)
drm_backend_la_SOURCES = \ drm_backend_la_SOURCES = \
compositor-drm.c \ compositor-drm.c \
tty.c \
udev-seat.c \ udev-seat.c \
udev-seat.h \ udev-seat.h \
evdev.c \ evdev.c \
...@@ -193,7 +192,8 @@ rpi_backend_la_SOURCES = \ ...@@ -193,7 +192,8 @@ rpi_backend_la_SOURCES = \
rpi-renderer.c \ rpi-renderer.c \
rpi-renderer.h \ rpi-renderer.h \
rpi-bcm-stubs.h \ rpi-bcm-stubs.h \
tty.c \ launcher-util.c \
launcher-util.h \
evdev.c \ evdev.c \
evdev.h \ evdev.h \
evdev-touchpad.c evdev-touchpad.c
...@@ -224,13 +224,13 @@ fbdev_backend_la_CFLAGS = \ ...@@ -224,13 +224,13 @@ fbdev_backend_la_CFLAGS = \
$(GCC_CFLAGS) $(GCC_CFLAGS)
fbdev_backend_la_SOURCES = \ fbdev_backend_la_SOURCES = \
compositor-fbdev.c \ compositor-fbdev.c \
tty.c \
udev-seat.c \ udev-seat.c \
udev-seat.h \ udev-seat.h \
evdev.c \ evdev.c \
evdev.h \ evdev.h \
evdev-touchpad.c \ evdev-touchpad.c \
launcher-util.c launcher-util.c \
launcher-util.h
endif endif
if ENABLE_RDP_COMPOSITOR if ENABLE_RDP_COMPOSITOR
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/vt.h>
#include <assert.h> #include <assert.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <time.h> #include <time.h>
...@@ -83,7 +84,6 @@ struct drm_compositor { ...@@ -83,7 +84,6 @@ struct drm_compositor {
int num_crtcs; int num_crtcs;
uint32_t crtc_allocator; uint32_t crtc_allocator;
uint32_t connector_allocator; uint32_t connector_allocator;
struct tty *tty;
struct wl_listener session_listener; struct wl_listener session_listener;
/* we need these parameters in order to not fail drmModeAddFB2() /* we need these parameters in order to not fail drmModeAddFB2()
...@@ -2240,13 +2240,7 @@ udev_drm_event(int fd, uint32_t mask, void *data) ...@@ -2240,13 +2240,7 @@ udev_drm_event(int fd, uint32_t mask, void *data)
static void static void
drm_restore(struct weston_compositor *ec) drm_restore(struct weston_compositor *ec)
{ {
struct drm_compositor *d = (struct drm_compositor *) ec; weston_launcher_restore(ec->launcher);
if (ec->launcher == NULL) {
if (drmDropMaster(d->drm.fd) < 0)
weston_log("failed to drop master: %m\n");
tty_reset(d->tty);
}
} }
static void static void
...@@ -2268,11 +2262,7 @@ drm_destroy(struct weston_compositor *ec) ...@@ -2268,11 +2262,7 @@ drm_destroy(struct weston_compositor *ec)
if (d->gbm) if (d->gbm)
gbm_device_destroy(d->gbm); gbm_device_destroy(d->gbm);
if (d->base.launcher == NULL) { weston_launcher_destroy(d->base.launcher);
if (drmDropMaster(d->drm.fd) < 0)
weston_log("failed to drop master: %m\n");
tty_destroy(d->tty);
}
close(d->drm.fd); close(d->drm.fd);
...@@ -2368,10 +2358,9 @@ session_notify(struct wl_listener *listener, void *data) ...@@ -2368,10 +2358,9 @@ session_notify(struct wl_listener *listener, void *data)
static void static void
switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data) switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{ {
struct drm_compositor *ec = data; struct weston_compositor *compositor = data;
if (ec->tty) weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1);
tty_activate_vt(ec->tty, key - KEY_F1 + 1);
} }
/* /*
...@@ -2575,7 +2564,7 @@ drm_compositor_create(struct wl_display *display, ...@@ -2575,7 +2564,7 @@ drm_compositor_create(struct wl_display *display,
/* Check if we run drm-backend using weston-launch */ /* Check if we run drm-backend using weston-launch */
ec->base.launcher = weston_launcher_connect(&ec->base); ec->base.launcher = weston_launcher_connect(&ec->base);
if (ec->base.launcher == NULL && geteuid() != 0) { if (ec->base.launcher == NULL) {
weston_log("fatal: drm backend should be run " weston_log("fatal: drm backend should be run "
"using weston-launch binary or as root\n"); "using weston-launch binary or as root\n");
goto err_compositor; goto err_compositor;
...@@ -2584,24 +2573,17 @@ drm_compositor_create(struct wl_display *display, ...@@ -2584,24 +2573,17 @@ drm_compositor_create(struct wl_display *display,
ec->udev = udev_new(); ec->udev = udev_new();
if (ec->udev == NULL) { if (ec->udev == NULL) {
weston_log("failed to initialize udev context\n"); weston_log("failed to initialize udev context\n");
goto err_compositor; goto err_launcher;
} }
ec->base.wl_display = display; ec->base.wl_display = display;
ec->session_listener.notify = session_notify; ec->session_listener.notify = session_notify;
wl_signal_add(&ec->base.session_signal, &ec->session_listener); wl_signal_add(&ec->base.session_signal, &ec->session_listener);
if (ec->base.launcher == NULL) {
ec->tty = tty_create(&ec->base, tty);
if (!ec->tty) {
weston_log("failed to initialize tty\n");
goto err_udev;
}
}
drm_device = find_primary_gpu(ec, seat_id); drm_device = find_primary_gpu(ec, seat_id);
if (drm_device == NULL) { if (drm_device == NULL) {
weston_log("no drm device found\n"); weston_log("no drm device found\n");
goto err_tty; goto err_udev;
} }
path = udev_device_get_syspath(drm_device); path = udev_device_get_syspath(drm_device);
...@@ -2696,11 +2678,8 @@ err_sprite: ...@@ -2696,11 +2678,8 @@ err_sprite:
destroy_sprites(ec); destroy_sprites(ec);
err_udev_dev: err_udev_dev:
udev_device_unref(drm_device); udev_device_unref(drm_device);
err_tty: err_launcher:
if (ec->base.launcher == NULL && drmDropMaster(ec->drm.fd) < 0) weston_launcher_destroy(ec->base.launcher);
weston_log("failed to drop master: %m\n");
if (ec->tty)
tty_destroy(ec->tty);
err_udev: err_udev:
udev_unref(ec->udev); udev_unref(ec->udev);
err_compositor: err_compositor:
......
...@@ -50,7 +50,6 @@ struct fbdev_compositor { ...@@ -50,7 +50,6 @@ struct fbdev_compositor {
uint32_t prev_state; uint32_t prev_state;
struct udev *udev; struct udev *udev;
struct tty *tty;
struct udev_input input; struct udev_input input;
int use_pixman; int use_pixman;
struct wl_listener session_listener; struct wl_listener session_listener;
...@@ -799,7 +798,7 @@ fbdev_compositor_destroy(struct weston_compositor *base) ...@@ -799,7 +798,7 @@ fbdev_compositor_destroy(struct weston_compositor *base)
/* Chain up. */ /* Chain up. */
compositor->base.renderer->destroy(&compositor->base); compositor->base.renderer->destroy(&compositor->base);
tty_destroy(compositor->tty); weston_launcher_destroy(compositor->base.launcher);
free(compositor); free(compositor);
} }
...@@ -849,19 +848,17 @@ session_notify(struct wl_listener *listener, void *data) ...@@ -849,19 +848,17 @@ session_notify(struct wl_listener *listener, void *data)
} }
static void static void
fbdev_restore(struct weston_compositor *base) fbdev_restore(struct weston_compositor *compositor)
{ {
struct fbdev_compositor *compositor = to_fbdev_compositor(base); weston_launcher_restore(compositor->launcher);
tty_reset(compositor->tty);
} }
static void static void
switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data) switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{ {
struct fbdev_compositor *ec = data; struct weston_compositor *compositor = data;
tty_activate_vt(ec->tty, key - KEY_F1 + 1); weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1);
} }
static struct weston_compositor * static struct weston_compositor *
...@@ -901,9 +898,9 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], ...@@ -901,9 +898,9 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
compositor->session_listener.notify = session_notify; compositor->session_listener.notify = session_notify;
wl_signal_add(&compositor->base.session_signal, wl_signal_add(&compositor->base.session_signal,
&compositor->session_listener); &compositor->session_listener);
compositor->tty = tty_create(&compositor->base, param->tty); compositor->base.launcher = weston_launcher_connect(&compositor->base);
if (!compositor->tty) { if (!compositor->base.launcher) {
weston_log("Failed to initialize tty.\n"); weston_log("Failed to set up launcher.\n");
goto out_udev; goto out_udev;
} }
...@@ -921,12 +918,12 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], ...@@ -921,12 +918,12 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
compositor); compositor);
if (compositor->use_pixman) { if (compositor->use_pixman) {
if (pixman_renderer_init(&compositor->base) < 0) if (pixman_renderer_init(&compositor->base) < 0)
goto out_tty; goto out_launcher;
} else { } else {
if (gl_renderer_create(&compositor->base, EGL_DEFAULT_DISPLAY, if (gl_renderer_create(&compositor->base, EGL_DEFAULT_DISPLAY,
gl_renderer_opaque_attribs, NULL) < 0) { gl_renderer_opaque_attribs, NULL) < 0) {
weston_log("gl_renderer_create failed.\n"); weston_log("gl_renderer_create failed.\n");
goto out_tty; goto out_launcher;
} }
} }
...@@ -940,8 +937,8 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], ...@@ -940,8 +937,8 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
out_pixman: out_pixman:
compositor->base.renderer->destroy(&compositor->base); compositor->base.renderer->destroy(&compositor->base);
out_tty: out_launcher:
tty_destroy(compositor->tty); weston_launcher_destroy(compositor->base.launcher);
out_udev: out_udev:
udev_unref(compositor->udev); udev_unref(compositor->udev);
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "compositor.h" #include "compositor.h"
#include "rpi-renderer.h" #include "rpi-renderer.h"
#include "evdev.h" #include "evdev.h"
#include "launcher-util.h"
#if 0 #if 0
#define DBG(...) \ #define DBG(...) \
...@@ -86,7 +87,6 @@ struct rpi_compositor { ...@@ -86,7 +87,6 @@ struct rpi_compositor {
uint32_t prev_state; uint32_t prev_state;
struct udev *udev; struct udev *udev;
struct tty *tty;
struct wl_listener session_listener; struct wl_listener session_listener;
int single_buffer; int single_buffer;
...@@ -656,7 +656,7 @@ rpi_compositor_destroy(struct weston_compositor *base) ...@@ -656,7 +656,7 @@ rpi_compositor_destroy(struct weston_compositor *base)
weston_compositor_shutdown(&compositor->base); weston_compositor_shutdown(&compositor->base);
compositor->base.renderer->destroy(&compositor->base); compositor->base.renderer->destroy(&compositor->base);
tty_destroy(compositor->tty); weston_launcher_destroy(compositor->base.launcher);
bcm_host_deinit(); bcm_host_deinit();
free(compositor); free(compositor);
...@@ -705,19 +705,17 @@ session_notify(struct wl_listener *listener, void *data) ...@@ -705,19 +705,17 @@ session_notify(struct wl_listener *listener, void *data)
} }
static void static void
rpi_restore(struct weston_compositor *base) rpi_restore(struct weston_compositor *compositor)
{ {
struct rpi_compositor *compositor = to_rpi_compositor(base); weston_launcher_restore(compositor->launcher);
tty_reset(compositor->tty);
} }
static void static void
switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data) switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
{ {
struct rpi_compositor *ec = data; struct weston_compositor *compositor = data;
tty_activate_vt(ec->tty, key - KEY_F1 + 1); weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1);
} }
struct rpi_parameters { struct rpi_parameters {
...@@ -754,8 +752,8 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[], ...@@ -754,8 +752,8 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
compositor->session_listener.notify = session_notify; compositor->session_listener.notify = session_notify;
wl_signal_add(&compositor->base.session_signal, wl_signal_add(&compositor->base.session_signal,
&compositor ->session_listener); &compositor ->session_listener);
compositor->tty = tty_create(&compositor->base, param->tty); compositor->base.launcher = weston_launcher_connect(&compositor->base);
if (!compositor->tty) { if (!compositor->base.launcher) {
weston_log("Failed to initialize tty.\n"); weston_log("Failed to initialize tty.\n");
goto out_udev; goto out_udev;
} }
...@@ -785,7 +783,7 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[], ...@@ -785,7 +783,7 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
bcm_host_init(); bcm_host_init();
if (rpi_renderer_create(&compositor->base, &param->renderer) < 0) if (rpi_renderer_create(&compositor->base, &param->renderer) < 0)
goto out_tty; goto out_launcher;
if (rpi_output_create(compositor, param->output_transform) < 0) if (rpi_output_create(compositor, param->output_transform) < 0)
goto out_renderer; goto out_renderer;
...@@ -797,8 +795,8 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[], ...@@ -797,8 +795,8 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
out_renderer: out_renderer:
compositor->base.renderer->destroy(&compositor->base); compositor->base.renderer->destroy(&compositor->base);
out_tty: out_launcher:
tty_destroy(compositor->tty); weston_launcher_destroy(compositor->base.launcher);
out_udev: out_udev:
udev_unref(compositor->udev); udev_unref(compositor->udev);
......
...@@ -28,12 +28,17 @@ ...@@ -28,12 +28,17 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <signal.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <sys/ioctl.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/major.h>
#include <xf86drm.h> #include <xf86drm.h>
...@@ -41,19 +46,28 @@ ...@@ -41,19 +46,28 @@
#include "launcher-util.h" #include "launcher-util.h"
#include "weston-launch.h" #include "weston-launch.h"
#define DRM_MAJOR 226
#ifndef KDSKBMUTE
#define KDSKBMUTE 0x4B51
#endif
union cmsg_data { unsigned char b[4]; int fd; }; union cmsg_data { unsigned char b[4]; int fd; };
struct weston_launcher { struct weston_launcher {
struct weston_compositor *compositor; struct weston_compositor *compositor;
int fd; int fd;
struct wl_event_source *source; struct wl_event_source *source;
int kb_mode, tty, drm_fd;
struct wl_event_source *vt_source;
}; };
int int
weston_launcher_open(struct weston_launcher *launcher, weston_launcher_open(struct weston_launcher *launcher,
const char *path, int flags) const char *path, int flags)
{ {
int n, ret = -1; int n, fd, ret = -1;
struct msghdr msg; struct msghdr msg;
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
struct iovec iov; struct iovec iov;
...@@ -61,9 +75,24 @@ weston_launcher_open(struct weston_launcher *launcher, ...@@ -61,9 +75,24 @@ weston_launcher_open(struct weston_launcher *launcher,
char control[CMSG_SPACE(sizeof data->fd)]; char control[CMSG_SPACE(sizeof data->fd)];
ssize_t len; ssize_t len;
struct weston_launcher_open *message; struct weston_launcher_open *message;
struct stat s;
if (launcher == NULL) if (launcher->fd == -1) {
return open(path, flags | O_CLOEXEC); fd = open(path, flags | O_CLOEXEC);
if (fd == -1)
return -1;
if (fstat(fd, &s) == -1) {
close(fd);
return -1;
}
if (major(s.st_rdev) == DRM_MAJOR)
launcher->drm_fd = fd;
return fd;
}
n = sizeof(*message) + strlen(path) + 1; n = sizeof(*message) + strlen(path) + 1;
message = malloc(n); message = malloc(n);
...@@ -112,6 +141,23 @@ weston_launcher_open(struct weston_launcher *launcher, ...@@ -112,6 +141,23 @@ weston_launcher_open(struct weston_launcher *launcher,
return data->fd; return data->fd;
} }
void
weston_launcher_restore(struct weston_launcher *launcher)
{
struct vt_mode mode = { 0 };
if (ioctl(launcher->tty, KDSKBMUTE, 0) &&
ioctl(launcher->tty, KDSKBMODE, launcher->kb_mode))
weston_log("failed to restore kb mode: %m\n");
if (ioctl(launcher->tty, KDSETMODE, KD_TEXT))
weston_log("failed to set KD_TEXT mode on tty: %m\n");
mode.mode = VT_AUTO;
if (ioctl(launcher->tty, VT_SETMODE, &mode) < 0)
weston_log("could not reset vt handling\n");
}
static int static int
weston_launcher_data(int fd, uint32_t mask, void *data) weston_launcher_data(int fd, uint32_t mask, void *data)
{ {
...@@ -120,6 +166,10 @@ weston_launcher_data(int fd, uint32_t mask, void *data) ...@@ -120,6 +166,10 @@ weston_launcher_data(int fd, uint32_t mask, void *data)
if (mask & (WL_EVENT_HANGUP | WL_EVENT_ERROR)) { if (mask & (WL_EVENT_HANGUP | WL_EVENT_ERROR)) {
weston_log("launcher socket closed, exiting\n"); weston_log("launcher socket closed, exiting\n");
/* Normally the weston-launch will reset the tty, but
* in this case it died or something, so do it here so
* we don't end up with a stuck vt. */
weston_launcher_restore(launcher);
exit(-1); exit(-1);
} }
...@@ -146,30 +196,111 @@ weston_launcher_data(int fd, uint32_t mask, void *data) ...@@ -146,30 +196,111 @@ weston_launcher_data(int fd, uint32_t mask, void *data)
return 1; return 1;
} }
static int
vt_handler(int signal_number, void *data)
{
struct weston_launcher *launcher = data;
struct weston_compositor *compositor = launcher->compositor;
if (compositor->session_active) {
compositor->session_active = 0;
wl_signal_emit(&compositor->session_signal, compositor);
if (launcher->drm_fd != -1)
drmDropMaster(launcher->drm_fd);
ioctl(launcher->tty, VT_RELDISP, 1);
} else {
ioctl(launcher->tty, VT_RELDISP, VT_ACKACQ);
if (launcher->drm_fd != -1)
drmSetMaster(launcher->drm_fd);
compositor->session_active = 1;
wl_signal_emit(&compositor->session_signal, compositor);
}
return 1;
}
static int
setup_tty(struct weston_launcher *launcher)
{
struct wl_event_loop *loop;
struct vt_mode mode = { 0 };
struct stat buf;
int ret;
if (fstat(STDIN_FILENO, &buf) == -1 ||
major(buf.st_rdev) != TTY_MAJOR || minor(buf.st_rdev) == 0) {
weston_log("stdin not a vt\n");
return -1;
}
launcher->tty = STDIN_FILENO;
if (ioctl(launcher->tty, KDGKBMODE, &launcher->kb_mode)) {
weston_log("failed to read keyboard mode: %m\n");
return -1;
}
if (ioctl(launcher->tty, KDSKBMUTE, 1) &&
ioctl(launcher->tty, KDSKBMODE, K_OFF)) {
weston_log("failed to set K_OFF keyboard mode: %m\n");
return -1;
}
ret = ioctl(launcher->tty, KDSETMODE, KD_GRAPHICS);
if (ret) {
weston_log("failed to set KD_GRAPHICS mode on tty: %m\n");
return -1;
}
mode.mode = VT_PROCESS;
mode.relsig = SIGUSR1;
mode.acqsig = SIGUSR1;
if (ioctl(launcher->tty, VT_SETMODE, &mode) < 0) {
weston_log("failed to take control of vt handling\n");
return -1;
}
loop = wl_display_get_event_loop(launcher->compositor->wl_display);
launcher->vt_source =
wl_event_loop_add_signal(loop, SIGUSR1, vt_handler, launcher);
if (!launcher->vt_source)
return -1;
return 0;
}
int
weston_launcher_activate_vt(struct weston_launcher *launcher, int vt)
{
return ioctl(launcher->tty, VT_ACTIVATE, vt);
}
struct weston_launcher * struct weston_launcher *
weston_launcher_connect(struct weston_compositor *compositor) weston_launcher_connect(struct weston_compositor *compositor)
{ {
struct weston_launcher *launcher; struct weston_launcher *launcher;
struct wl_event_loop *loop; struct wl_event_loop *loop;
int fd;
fd = weston_environment_get_fd("WESTON_LAUNCHER_SOCK");
if (fd == -1)
return NULL;
launcher = malloc(sizeof *launcher); launcher = malloc(sizeof *launcher);
if (launcher == NULL) if (launcher == NULL)
return NULL; return NULL;
launcher->compositor = compositor; launcher->compositor = compositor;
launcher->fd = fd; launcher->drm_fd = -1;
launcher->fd = weston_environment_get_fd("WESTON_LAUNCHER_SOCK");
loop = wl_display_get_event_loop(compositor->wl_display); if (launcher->fd != -1) {
launcher->source = wl_event_loop_add_fd(loop, launcher->fd, launcher->tty = weston_environment_get_fd("WESTON_TTY_FD");
WL_EVENT_READABLE, loop = wl_display_get_event_loop(compositor->wl_display);
weston_launcher_data, launcher->source = wl_event_loop_add_fd(loop, launcher->fd,
launcher); WL_EVENT_READABLE,
if (launcher->source == NULL) { weston_launcher_data,
launcher);
if (launcher->source == NULL) {
free(launcher);
return NULL;
}
} else if (geteuid() == 0) {
setup_tty(launcher);
} else {
free(launcher); free(launcher);
return NULL; return NULL;
} }
...@@ -180,6 +311,13 @@ weston_launcher_connect(struct weston_compositor *compositor) ...@@ -180,6 +311,13 @@ weston_launcher_connect(struct weston_compositor *compositor)
void void
weston_launcher_destroy(struct weston_launcher *launcher) weston_launcher_destroy(struct weston_launcher *launcher)
{ {
close(launcher->fd); if (launcher->fd != -1) {
close(launcher->fd);
wl_event_source_remove(launcher->source);
} else {
weston_launcher_restore(launcher);
wl_event_source_remove(launcher->vt_source);
}
free(launcher); free(launcher);
} }
...@@ -39,4 +39,10 @@ int ...@@ -39,4 +39,10 @@ int
weston_launcher_open(struct weston_launcher *launcher, weston_launcher_open(struct weston_launcher *launcher,
const char *path, int flags); const char *path, int flags);
int
weston_launcher_activate_vt(struct weston_launcher *launcher, int vt);
void
weston_launcher_restore(struct weston_launcher *launcher);
#endif #endif
/*
* Copyright © 2010 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the