aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-03-23 00:55:55 +0100
committeremersion <contact@emersion.fr>2018-03-23 00:55:55 +0100
commita854c2f24677595110859373c75eb8ec5e50f91e (patch)
tree50bde81f0a3b4a9a66f1e029823c391cb7345657 /backend
parent60bfe0a6aad6bc415f84a52326c9a0851fc647c0 (diff)
parentef3769851f1b8586951cdf3ae71c3529f95a8fd6 (diff)
Merge branch 'master' into gles2-renderer-redesign
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/backend.c2
-rw-r--r--backend/drm/renderer.c2
-rw-r--r--backend/headless/output.c2
-rw-r--r--backend/wayland/wl_seat.c17
-rw-r--r--backend/x11/backend.c11
5 files changed, 29 insertions, 5 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index 75b44210..43a8d017 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -173,7 +173,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
}
if (!wlr_egl_bind_display(&drm->renderer.egl, display)) {
- wlr_log(L_INFO, "Failed to bind egl/wl display: %s", egl_error());
+ wlr_log(L_INFO, "Failed to bind egl/wl display");
}
drm->display_destroy.notify = handle_display_destroy;
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 3b9aaded..b2998b5f 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -210,7 +210,7 @@ static struct wlr_texture *get_tex_for_bo(struct wlr_drm_renderer *renderer,
tex->img = eglCreateImageKHR(renderer->egl.display, EGL_NO_CONTEXT,
EGL_LINUX_DMA_BUF_EXT, NULL, attribs);
if (!tex->img) {
- wlr_log(L_ERROR, "Failed to create EGL image: %s", egl_error());
+ wlr_log(L_ERROR, "Failed to create EGL image");
abort();
}
diff --git a/backend/headless/output.c b/backend/headless/output.c
index 4746d2f2..a13ed22c 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -13,7 +13,7 @@ static EGLSurface egl_create_surface(struct wlr_egl *egl, unsigned int width,
EGLSurface surf = eglCreatePbufferSurface(egl->display, egl->config, attribs);
if (surf == EGL_NO_SURFACE) {
- wlr_log(L_ERROR, "Failed to create EGL surface: %s", egl_error());
+ wlr_log(L_ERROR, "Failed to create EGL surface");
return EGL_NO_SURFACE;
}
return surf;
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 841e693d..6ca59130 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -26,6 +26,11 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
// GNOME sends a pointer enter when the surface is being destroyed
return;
}
+ if (wlr_wl_pointer->current_output) {
+ wl_list_remove(&wlr_wl_pointer->output_destroy_listener.link);
+ }
+ wl_signal_add(&output->wlr_output.events.destroy,
+ &wlr_wl_pointer->output_destroy_listener);
wlr_wl_pointer->current_output = output;
output->enter_serial = serial;
wlr_wl_output_update_cursor(output);
@@ -49,7 +54,7 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
struct wlr_wl_pointer *wlr_wl_pointer =
(struct wlr_wl_pointer *)dev->pointer;
if (!wlr_wl_pointer->current_output) {
- wlr_log(L_ERROR, "pointer motion event without current output");
+ wlr_log(L_DEBUG, "pointer motion event without current output");
return;
}
@@ -231,6 +236,14 @@ static struct wlr_input_device *allocate_device(struct wlr_wl_backend *backend,
return wlr_device;
}
+static void wlr_wl_pointer_handle_output_destroy(struct wl_listener *listener,
+ void *data) {
+ struct wlr_wl_pointer *wlr_wl_pointer =
+ wl_container_of(listener, wlr_wl_pointer, output_destroy_listener);
+ wlr_wl_pointer->current_output = NULL;
+ wl_list_remove(&wlr_wl_pointer->output_destroy_listener.link);
+}
+
static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
enum wl_seat_capability caps) {
struct wlr_wl_backend *backend = data;
@@ -243,6 +256,8 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
wlr_log(L_ERROR, "Unable to allocate wlr_wl_pointer");
return;
}
+ wlr_wl_pointer->output_destroy_listener.notify =
+ wlr_wl_pointer_handle_output_destroy;
struct wlr_input_device *wlr_device;
if (!(wlr_device = allocate_device(backend, WLR_INPUT_DEVICE_POINTER))) {
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index cb29e518..dd2c0a6e 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -143,6 +143,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
};
wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);
+ free(pointer);
break;
}
case XCB_CLIENT_MESSAGE: {
@@ -317,12 +318,20 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) {
wlr_signal_emit_safe(&backend->events.destroy, backend);
+ if (x11->event_source) {
+ wl_event_source_remove(x11->event_source);
+ }
wl_list_remove(&x11->display_destroy.link);
wl_event_source_remove(x11->frame_timer);
wlr_egl_finish(&x11->egl);
- xcb_disconnect(x11->xcb_conn);
+ if (x11->xcb_conn) {
+ xcb_disconnect(x11->xcb_conn);
+ }
+ if (x11->xlib_conn) {
+ XCloseDisplay(x11->xlib_conn);
+ }
free(x11);
}