From ce8786721b17febb5132c136213c95a095f13121 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sun, 14 May 2017 12:31:22 +1200 Subject: Got it working. --- backend/drm/backend.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'backend') diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 48e207c8..3c7af14b 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -47,12 +47,13 @@ static void device_paused(struct wl_listener *listener, void *data) { } static void device_resumed(struct wl_listener *listener, void *data) { - struct wlr_backend_state *drm = wl_container_of(listener, drm, device_paused); + struct wlr_backend_state *drm = wl_container_of(listener, drm, device_resumed); int *new_fd = data; - close(drm->fd); - drm->fd = *new_fd; - drm->renderer.fd = *new_fd; + if (dup2(*new_fd, drm->fd) < 0) { + wlr_log(L_ERROR, "dup2 failed: %s", strerror(errno)); + return; + } for (size_t i = 0; i < drm->outputs->length; ++i) { struct wlr_output_state *output = drm->outputs->items[i]; -- cgit v1.2.3