Improve wayland backend pointer error logging

This commit is contained in:
nyorain 2017-06-22 18:04:13 +02:00
parent dbde1f7340
commit 4ca872c914

View File

@ -30,7 +30,9 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
uint32_t serial, struct wl_surface *surface) {
struct wlr_input_device *dev = data;
assert(dev && dev->pointer && dev->pointer->state);
dev->pointer->state->current_output = NULL;
}
static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
@ -38,7 +40,11 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
struct wlr_input_device *dev = data;
assert(dev && dev->pointer && dev->pointer->state);
struct wlr_pointer_state *state = dev->pointer->state;
assert(state->current_output);
if(!state->current_output) {
wlr_log(L_ERROR, "pointer motion event without current output");
return;
}
int width, height;
wl_egl_window_get_attached_size(state->current_output->state->egl_window,